提交 fb26230c 编写于 作者: M mcimadamore

8008444: Inherited generic functional descriptors are merged incorrectly

Summary: Missing call to Types.createMethodWithThrownTypes
Reviewed-by: jjg
上级 59712d93
......@@ -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);
}
};
}
......
/*
* @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
}
}
LambdaConv25.java:19:15: compiler.err.prob.found.req: (compiler.misc.invalid.generic.lambda.target: <X>()void, kindname.interface, LambdaConv25.C)
1 error
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册