Other |
---|
tbd_majorUnresolved |
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
The specification for assignment contexts (JLS 5.2) allows an unboxing conversion followed by a widening primitive conversion. It does _not_ allow a widening reference conversion before this occurs. But javac is permitting it. The following is allowed: <T extends Integer> void test(T arg) { int i = arg; // JLS: error; javac: ok } But not the complementary boxing case: void test2(int i) { Long l = i; // JLS: error; javac: error }
|