composition of extends/super wildcard should get just its bound (IDEA-96721)

This commit is contained in:
anna
2012-12-14 15:31:23 +01:00
parent b8c340ff6b
commit c484ce61f0
3 changed files with 17 additions and 1 deletions
@@ -0,0 +1,15 @@
class NodeProperty<A, B> {}
class NodeType {}
class NumberExpression extends NodeType {}
class Node<NodeTypeT extends NodeType> {
public <ValueT> ValueT get(NodeProperty<? super NodeTypeT, ValueT> prop) {
return null;
}
}
class Main {
public static void main(NodeProperty<NumberExpression, Integer> nval, Node<? extends NodeType> expr) {
int val = expr.get<error descr="'get(NodeProperty<NodeType,java.lang.Integer>)' in 'Node' cannot be applied to '(NodeProperty<NumberExpression,java.lang.Integer>)'">(nval)</error>;
}
}