mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8002099: Add support for intersection types in cast expression
Add parser and type-checking support for intersection types in cast expressions Reviewed-by: jjg
This commit is contained in:
parent
c76c08e82a
commit
d7884e5ae2
38 changed files with 1873 additions and 229 deletions
|
@ -90,9 +90,14 @@ public class LambdaParserTest {
|
|||
enum LambdaParameterKind {
|
||||
IMPLICIT(""),
|
||||
EXPLIICT_SIMPLE("A"),
|
||||
EXPLIICT_SIMPLE_ARR1("A[]"),
|
||||
EXPLIICT_SIMPLE_ARR2("A[][]"),
|
||||
EXPLICIT_VARARGS("A..."),
|
||||
EXPLICIT_GENERIC1("A<X>"),
|
||||
EXPLICIT_GENERIC3("A<? extends X, ? super Y>");
|
||||
EXPLICIT_GENERIC2("A<? extends X, ? super Y>"),
|
||||
EXPLICIT_GENERIC2_VARARGS("A<? extends X, ? super Y>..."),
|
||||
EXPLICIT_GENERIC2_ARR1("A<? extends X, ? super Y>[]"),
|
||||
EXPLICIT_GENERIC2_ARR2("A<? extends X, ? super Y>[][]");
|
||||
|
||||
String parameterType;
|
||||
|
||||
|
@ -103,6 +108,11 @@ public class LambdaParserTest {
|
|||
boolean explicit() {
|
||||
return this != IMPLICIT;
|
||||
}
|
||||
|
||||
boolean isVarargs() {
|
||||
return this == EXPLICIT_VARARGS ||
|
||||
this == EXPLICIT_GENERIC2_VARARGS;
|
||||
}
|
||||
}
|
||||
|
||||
enum ModifierKind {
|
||||
|
@ -253,7 +263,7 @@ public class LambdaParserTest {
|
|||
|
||||
if (lk.arity() == 2 &&
|
||||
(pk1.explicit() != pk2.explicit() ||
|
||||
pk1 == LambdaParameterKind.EXPLICIT_VARARGS)) {
|
||||
pk1.isVarargs())) {
|
||||
errorExpected = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue