Details
-
Bug
-
Resolution: Fixed
-
P2
-
8
-
b99
-
b106
-
Verified
Description
Somehow javac is mixing up the method type argument with the class type argument when the method reference is like
MyTest<Q>::<Object>new,
where Q is a reference type.
The correct behavior here must be to ignore the method type arguments and proceed cleanly -- see, for example, this comment from 15.12.2.1:
"This clause implies that a non-generic method may be potentially applicable to an invocation that supplies explicit type arguments. Indeed, it may turn out to be applicable. In such a case, the type arguments will simply be ignored."
For nested classes compilation succeeds. The problem happens for top level classes only.
The following JCK tests fail:
lang/LMBD/lmbd131/lmbd13101m0022/lmbd13101m0022.html
lang/LMBD/lmbd131/lmbd13101m0055/lmbd13101m0055.html
lang/LMBD/lmbd131/lmbd13101m1022/lmbd13101m1022.html
lang/LMBD/lmbd131/lmbd13101m1055/lmbd13101m1055.html
MyTest<Q>::<Object>new,
where Q is a reference type.
The correct behavior here must be to ignore the method type arguments and proceed cleanly -- see, for example, this comment from 15.12.2.1:
"This clause implies that a non-generic method may be potentially applicable to an invocation that supplies explicit type arguments. Indeed, it may turn out to be applicable. In such a case, the type arguments will simply be ignored."
For nested classes compilation succeeds. The problem happens for top level classes only.
The following JCK tests fail:
lang/LMBD/lmbd131/lmbd13101m0022/lmbd13101m0022.html
lang/LMBD/lmbd131/lmbd13101m0055/lmbd13101m0055.html
lang/LMBD/lmbd131/lmbd13101m1022/lmbd13101m1022.html
lang/LMBD/lmbd131/lmbd13101m1055/lmbd13101m1055.html