Ambiguity method error when one method can't be applicable
Vicente-Arturo Romero-Zaldivar
vicente.romero at oracle.com
Fri Nov 1 13:54:40 PDT 2013
Hi Anna,
Sorry for the late reply, I guess I lost the track of this issue.
The chageset you have mentioned implements a new approach to unstick
lambda expressions which has been discussed a lot in this list.
Check for example [1] and other mails in the thread.
Thanks,
Vicente
[1]
http://mail.openjdk.java.net/pipermail/lambda-dev/2013-August/010704.html
On 09/10/13 12:28, Anna Kozlova wrote:
> Hi,
>
> It looks like that the change which caused the problem is
> http://hg.openjdk.java.net/lambda/lambda/langtools/rev/4a6acc42c3a1. The
> test data e.g.
> http://hg.openjdk.java.net/lambda/lambda/langtools/file/4a6acc42c3a1/test/to
> ols/javac/lambda/TargetType02.java was changed exactly in a way I've
> described.
>
> The change itself is quite complicated and javac specific so I am not sure I
> understand how it is connected to the spec. Could you please help?
>
> Thank you
> Anna Kozlova
> JetBrains
> http://www.jetbrains.com
> "Develop with pleasure!"
>
>
>
> -----Original Message-----
> From: lambda-dev-bounces at openjdk.java.net
> [mailto:lambda-dev-bounces at openjdk.java.net] On Behalf Of Anna Kozlova
> Sent: Tuesday, October 08, 2013 5:53 PM
> To: lambda-dev at openjdk.java.net
> Subject: Ambiguity method error when one method can't be applicable
>
> Hi guys,
>
>
>
> The following code does not compile with ambiguous method error:
>
>
>
> class MyTest {
>
>
>
> interface I1 {
>
> Foo<Number> m(String s);
>
> }
>
>
>
> interface I2 {
>
> Foo<Number> m(Integer i);
>
> }
>
>
>
> static class Foo<T extends Number> {
>
> Foo(T t) {
>
> System.out.println(t);
>
> }
>
> }
>
>
>
> private static void m(I1 i) {}
>
> private static void m(I2 i) {}
>
>
>
> public static void main(String[] args) {
>
> m(Foo::new);
>
> }
>
> }
>
>
>
> Some time ago though there was no such an error.
>
>
>
> Not sure that I understand why compiler can't resolve such an ambiguity for
> me. Could someone explain, please?
>
>
>
> Thank you
> Anna Kozlova
> JetBrains
> <http://www.intellij.com/> http://www.jetbrains.com "Develop with
> pleasure!"
>
>
>
>
>
> !DSPAM:35,52542aaf317841350320123!
>
>
More information about the lambda-dev
mailing list