langtools/test/tools/javac/cast/BoxedArray.java
author hannesw
Tue, 22 Mar 2016 14:23:16 +0100
changeset 36690 06b714373aa4
parent 24796 f940af3221e2
permissions -rw-r--r--
8151810: for-in iteration does not provide per-iteration scope Reviewed-by: attila, lagergren

/*
 * @test /nodynamiccopyright/
 * @bug 5014309
 * @summary REGRESSION: compiler allows cast from Integer[] to int[]
 * @author gafter
 *
 * @compile/fail/ref=BoxedArray.out -XDrawDiagnostics  BoxedArray.java
 */

public class BoxedArray {
    int[] a2;
    void f(Integer[] a1) {
        a2 = (int[]) a1;
    }
}