8008444: Inherited generic functional descriptors are merged incorrectly
Missing call to Types.createMethodWithThrownTypes Reviewed-by: jjg
This commit is contained in:
parent
6fd868a306
commit
73b1aee3f4
@ -512,7 +512,7 @@ public class Types {
|
||||
@Override
|
||||
public Type getType(Type origin) {
|
||||
Type mt = memberType(origin, getSymbol());
|
||||
return new MethodType(mt.getParameterTypes(), mt.getReturnType(), thrown1, syms.methodClass);
|
||||
return createMethodTypeWithThrown(mt, thrown1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
21
langtools/test/tools/javac/lambda/LambdaConv25.java
Normal file
21
langtools/test/tools/javac/lambda/LambdaConv25.java
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @summary check that merged inherited descriptors preservers type-parameters
|
||||
* @compile/fail/ref=LambdaConv25.out -XDrawDiagnostics LambdaConv25.java
|
||||
*/
|
||||
class LambdaConv25 {
|
||||
|
||||
interface A {
|
||||
<X> void m();
|
||||
}
|
||||
|
||||
interface B {
|
||||
<X> void m();
|
||||
}
|
||||
|
||||
interface C extends A, B { }
|
||||
|
||||
void test() {
|
||||
C c = ()->{}; //should fail
|
||||
}
|
||||
}
|
2
langtools/test/tools/javac/lambda/LambdaConv25.out
Normal file
2
langtools/test/tools/javac/lambda/LambdaConv25.out
Normal file
@ -0,0 +1,2 @@
|
||||
LambdaConv25.java:19:15: compiler.err.prob.found.req: (compiler.misc.invalid.generic.lambda.target: <X>()void, kindname.interface, LambdaConv25.C)
|
||||
1 error
|
Loading…
x
Reference in New Issue
Block a user