diff options
author | vromero <none@none> | 2014-06-19 15:39:37 +0100 |
---|---|---|
committer | vromero <none@none> | 2014-06-19 15:39:37 +0100 |
commit | d06021f9feb1b6e42d0c12f40a5c7c9a93288b6c (patch) | |
tree | d33da07ddd6835b823fffc6af69d942d350c483d /test | |
parent | 79bf1d01fe4cb5de2b581da86644a11c1c8f7ee6 (diff) |
8038182: javac crash with FunctionDescriptorLookupError for invalid functional interface
Reviewed-by: mcimadamore
Contributed-by: maurizio.cimadamore@oracle.com, vicente.romero@oracle.com
Diffstat (limited to 'test')
-rw-r--r-- | test/tools/javac/lambda/T8038182/CrashFunctionDescriptorExceptionTest.java | 24 | ||||
-rw-r--r-- | test/tools/javac/lambda/T8038182/CrashFunctionDescriptorExceptionTest.out | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/tools/javac/lambda/T8038182/CrashFunctionDescriptorExceptionTest.java b/test/tools/javac/lambda/T8038182/CrashFunctionDescriptorExceptionTest.java new file mode 100644 index 00000000..51895dc3 --- /dev/null +++ b/test/tools/javac/lambda/T8038182/CrashFunctionDescriptorExceptionTest.java @@ -0,0 +1,24 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8038182 + * @summary javac crash with FunctionDescriptorLookupError for invalid functional interface + * @compile/fail/ref=CrashFunctionDescriptorExceptionTest.out -XDrawDiagnostics CrashFunctionDescriptorExceptionTest.java + */ + +class CrashFunctionDescriptorExceptionTest { + + @SuppressWarnings("unchecked") + void m () { + bar((B b) -> {}); + } + + <E extends A<E>> void bar(I<E> i) {} + + class A<E> {} + + class B<E> extends A<E> {} + + interface I<E extends A<E>> { + void foo(E e); + } +} diff --git a/test/tools/javac/lambda/T8038182/CrashFunctionDescriptorExceptionTest.out b/test/tools/javac/lambda/T8038182/CrashFunctionDescriptorExceptionTest.out new file mode 100644 index 00000000..19f5569a --- /dev/null +++ b/test/tools/javac/lambda/T8038182/CrashFunctionDescriptorExceptionTest.out @@ -0,0 +1,2 @@ +CrashFunctionDescriptorExceptionTest.java:12:13: compiler.err.prob.found.req: (compiler.misc.no.suitable.functional.intf.inst: CrashFunctionDescriptorExceptionTest.I<CrashFunctionDescriptorExceptionTest.B>) +1 error |