-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8334466: Ambiguous method call with generics may cause FunctionDescri…
…ptorLookupError Reviewed-by: jlahoda
- Loading branch information
Vicente Romero
committed
Aug 12, 2024
1 parent
89a15f1
commit 61d1dc5
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
test/langtools/tools/javac/lambda/CrashWithFunctionDescriptorLookupErrorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* @test /nodynamiccopyright/ | ||
* @bug 8334466 | ||
* @summary Ambiguous method call with generics may cause FunctionDescriptorLookupError | ||
* @compile/fail/ref=CrashWithFunctionDescriptorLookupErrorTest.out -XDrawDiagnostics CrashWithFunctionDescriptorLookupErrorTest.java | ||
*/ | ||
|
||
import java.util.List; | ||
|
||
class CrashWithFunctionDescriptorLookupErrorTest { | ||
void m() { | ||
List<X> list = List.of(new X()); | ||
test(list.get(0)); | ||
} | ||
|
||
void test(A<?> a) { } | ||
void test(B<?> b) { } | ||
|
||
interface A<T extends A<T>> { T a(); } | ||
interface B<T extends B<T>> { T b(); } | ||
class X implements A<X>, B<X> { | ||
public X a() { return null; } | ||
public X b() { return null; } | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
test/langtools/tools/javac/lambda/CrashWithFunctionDescriptorLookupErrorTest.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CrashWithFunctionDescriptorLookupErrorTest.java:13:9: compiler.err.ref.ambiguous: test, kindname.method, test(CrashWithFunctionDescriptorLookupErrorTest.A<?>), CrashWithFunctionDescriptorLookupErrorTest, kindname.method, test(CrashWithFunctionDescriptorLookupErrorTest.B<?>), CrashWithFunctionDescriptorLookupErrorTest | ||
1 error |
61d1dc5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues