mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8268859: jshell throws exception while parsing illegal "case true"
Reviewed-by: mcimadamore
This commit is contained in:
@@ -772,8 +772,8 @@ public class JavacParser implements Parser {
|
||||
accept(RPAREN);
|
||||
pattern = toP(F.at(startPos).ParenthesizedPattern(p));
|
||||
} else {
|
||||
JCExpression e = parsedType == null ? term(EXPR | TYPE | NOLAMBDA) : parsedType;
|
||||
mods = mods != null ? mods : F.at(token.pos).Modifiers(0);
|
||||
mods = mods != null ? mods : optFinal(0);
|
||||
JCExpression e = parsedType == null ? term(TYPE | NOLAMBDA) : parsedType;
|
||||
JCVariableDecl var = toP(F.at(token.pos).VarDef(mods, ident(), e, null));
|
||||
pattern = toP(F.at(pos).BindingPattern(var));
|
||||
}
|
||||
@@ -1694,16 +1694,12 @@ public class JavacParser implements Parser {
|
||||
* method reference or a binary expression. To disambiguate, look for a
|
||||
* matching '>' and see if the subsequent terminal is either '.' or '::'.
|
||||
*/
|
||||
ParensResult analyzeParens() {
|
||||
return analyzeParens(0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("fallthrough")
|
||||
ParensResult analyzeParens(int startLookahead) {
|
||||
ParensResult analyzeParens() {
|
||||
int depth = 0;
|
||||
boolean type = false;
|
||||
ParensResult defaultResult = ParensResult.PARENS;
|
||||
outer: for (int lookahead = startLookahead; ; lookahead++) {
|
||||
outer: for (int lookahead = 0; ; lookahead++) {
|
||||
TokenKind tk = S.token(lookahead).kind;
|
||||
switch (tk) {
|
||||
case COMMA:
|
||||
@@ -1729,7 +1725,7 @@ public class JavacParser implements Parser {
|
||||
}
|
||||
break;
|
||||
case LPAREN:
|
||||
if (lookahead != startLookahead) {
|
||||
if (lookahead != 0) {
|
||||
// '(' in a non-starting position -> parens
|
||||
return ParensResult.PARENS;
|
||||
} else if (peekToken(lookahead, RPAREN)) {
|
||||
@@ -1780,31 +1776,7 @@ public class JavacParser implements Parser {
|
||||
return ParensResult.EXPLICIT_LAMBDA;
|
||||
case MONKEYS_AT:
|
||||
type = true;
|
||||
lookahead += 1; //skip '@'
|
||||
while (peekToken(lookahead, DOT)) {
|
||||
lookahead += 2;
|
||||
}
|
||||
if (peekToken(lookahead, LPAREN)) {
|
||||
lookahead++;
|
||||
//skip annotation values
|
||||
int nesting = 0;
|
||||
for (; ; lookahead++) {
|
||||
TokenKind tk2 = S.token(lookahead).kind;
|
||||
switch (tk2) {
|
||||
case EOF:
|
||||
return ParensResult.PARENS;
|
||||
case LPAREN:
|
||||
nesting++;
|
||||
break;
|
||||
case RPAREN:
|
||||
nesting--;
|
||||
if (nesting == 0) {
|
||||
continue outer;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
lookahead = skipAnnotation(lookahead);
|
||||
break;
|
||||
case LBRACKET:
|
||||
if (peekToken(lookahead, RBRACKET, LAX_IDENTIFIER)) {
|
||||
@@ -1861,6 +1833,35 @@ public class JavacParser implements Parser {
|
||||
}
|
||||
}
|
||||
|
||||
private int skipAnnotation(int lookahead) {
|
||||
lookahead += 1; //skip '@'
|
||||
while (peekToken(lookahead, DOT)) {
|
||||
lookahead += 2;
|
||||
}
|
||||
if (peekToken(lookahead, LPAREN)) {
|
||||
lookahead++;
|
||||
//skip annotation values
|
||||
int nesting = 0;
|
||||
for (; ; lookahead++) {
|
||||
TokenKind tk2 = S.token(lookahead).kind;
|
||||
switch (tk2) {
|
||||
case EOF:
|
||||
return lookahead;
|
||||
case LPAREN:
|
||||
nesting++;
|
||||
break;
|
||||
case RPAREN:
|
||||
nesting--;
|
||||
if (nesting == 0) {
|
||||
return lookahead;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return lookahead;
|
||||
}
|
||||
|
||||
/** Accepts all identifier-like tokens */
|
||||
protected Predicate<TokenKind> LAX_IDENTIFIER = t -> t == IDENTIFIER || t == UNDERSCORE || t == ASSERT || t == ENUM;
|
||||
|
||||
@@ -3067,34 +3068,69 @@ public class JavacParser implements Parser {
|
||||
nextToken();
|
||||
label = toP(F.at(patternPos).DefaultCaseLabel());
|
||||
} else {
|
||||
if (token.kind == LPAREN) {
|
||||
int lookahead = 0;
|
||||
while (S.token(lookahead + 1).kind == LPAREN) {
|
||||
lookahead++;
|
||||
}
|
||||
boolean pattern = analyzeParens(lookahead) == ParensResult.EXPLICIT_LAMBDA;
|
||||
if (pattern) {
|
||||
checkSourceLevel(token.pos, Feature.PATTERN_SWITCH);
|
||||
return parsePattern(token.pos, null, null, false);
|
||||
} else {
|
||||
return term(EXPR | TYPE | NOLAMBDA);
|
||||
}
|
||||
int lookahead = 0;
|
||||
while (S.token(lookahead).kind == LPAREN) {
|
||||
lookahead++;
|
||||
}
|
||||
JCModifiers mods = optFinal(0);
|
||||
boolean pattern = mods.flags != 0 || mods.annotations.nonEmpty() ||
|
||||
analyzePattern(lookahead) == PatternResult.PATTERN;
|
||||
if (pattern) {
|
||||
checkSourceLevel(token.pos, Feature.PATTERN_SWITCH);
|
||||
return parsePattern(patternPos, mods, null, false);
|
||||
} else {
|
||||
JCModifiers mods = optFinal(0);
|
||||
JCExpression e = term(EXPR | TYPE | NOLAMBDA);
|
||||
|
||||
if (token.kind == IDENTIFIER || mods.flags != 0 || mods.annotations.nonEmpty()) {
|
||||
checkSourceLevel(token.pos, Feature.PATTERN_SWITCH);
|
||||
return parsePattern(patternPos, null, e, false);
|
||||
} else {
|
||||
return e;
|
||||
}
|
||||
return term(EXPR | NOLAMBDA);
|
||||
}
|
||||
}
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
@SuppressWarnings("fallthrough")
|
||||
PatternResult analyzePattern(int lookahead) {
|
||||
int depth = 0;
|
||||
while (true) {
|
||||
TokenKind token = S.token(lookahead).kind;
|
||||
switch (token) {
|
||||
case BYTE: case SHORT: case INT: case LONG: case FLOAT:
|
||||
case DOUBLE: case BOOLEAN: case CHAR: case VOID:
|
||||
case ASSERT, ENUM, IDENTIFIER, UNDERSCORE:
|
||||
if (depth == 0 && peekToken(lookahead, LAX_IDENTIFIER)) return PatternResult.PATTERN;
|
||||
break;
|
||||
case DOT, QUES, EXTENDS, SUPER, COMMA: break;
|
||||
case LT: depth++; break;
|
||||
case GTGTGT: depth--;
|
||||
case GTGT: depth--;
|
||||
case GT:
|
||||
depth--;
|
||||
if (depth == 0) {
|
||||
return peekToken(lookahead, LAX_IDENTIFIER) ? PatternResult.PATTERN
|
||||
: PatternResult.EXPRESSION;
|
||||
} else if (depth < 0) return PatternResult.EXPRESSION;
|
||||
break;
|
||||
case MONKEYS_AT:
|
||||
lookahead = skipAnnotation(lookahead);
|
||||
break;
|
||||
case LBRACKET:
|
||||
if (peekToken(lookahead, RBRACKET, LAX_IDENTIFIER)) {
|
||||
return PatternResult.PATTERN;
|
||||
} else if (peekToken(lookahead, RBRACKET)) {
|
||||
lookahead++;
|
||||
break;
|
||||
} else {
|
||||
return PatternResult.EXPRESSION;
|
||||
}
|
||||
default: return PatternResult.EXPRESSION;
|
||||
}
|
||||
lookahead++;
|
||||
}
|
||||
}
|
||||
|
||||
private enum PatternResult {
|
||||
EXPRESSION,
|
||||
PATTERN;
|
||||
}
|
||||
|
||||
/** MoreStatementExpressions = { COMMA StatementExpression }
|
||||
*/
|
||||
<T extends ListBuffer<? super JCExpressionStatement>> T moreStatementExpressions(int pos,
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @modules jdk.compiler/com.sun.tools.javac.file
|
||||
@@ -5,8 +28,8 @@
|
||||
* jdk.compiler/com.sun.tools.javac.parser
|
||||
* jdk.compiler/com.sun.tools.javac.tree
|
||||
* jdk.compiler/com.sun.tools.javac.util
|
||||
* @compile --enable-preview -source ${jdk.version} DisambiguateParenthesizedPattern.java
|
||||
* @run main/othervm --enable-preview DisambiguateParenthesizedPattern
|
||||
* @compile --enable-preview -source ${jdk.version} DisambiguatePatterns.java
|
||||
* @run main/othervm --enable-preview DisambiguatePatterns
|
||||
*/
|
||||
|
||||
import com.sun.source.tree.CaseLabelTree;
|
||||
@@ -24,16 +47,18 @@ import com.sun.tools.javac.main.Option;
|
||||
import com.sun.tools.javac.util.Options;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public class DisambiguateParenthesizedPattern {
|
||||
public class DisambiguatePatterns {
|
||||
|
||||
public static void main(String... args) throws Throwable {
|
||||
DisambiguateParenthesizedPattern test = new DisambiguateParenthesizedPattern();
|
||||
DisambiguatePatterns test = new DisambiguatePatterns();
|
||||
test.disambiguationTest("String s",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("String s && s.isEmpty()",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("(String s)",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("(@Ann String s)",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("((String s))",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("(String) s",
|
||||
@@ -56,11 +81,41 @@ public class DisambiguateParenthesizedPattern {
|
||||
ExpressionType.EXPRESSION);
|
||||
test.disambiguationTest("(a < c.d > b)",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a<? extends c.d> b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("@Ann a<? extends c.d> b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a<? extends @Ann c.d> b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a<? super c.d> b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a<? super @Ann c.d> b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a<b<c.d>> b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a<b<@Ann c.d>> b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a<b<c<d>>> b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a[] b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a[][] b",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("int i",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("int[] i",
|
||||
ExpressionType.PATTERN);
|
||||
test.disambiguationTest("a[a]",
|
||||
ExpressionType.EXPRESSION);
|
||||
test.disambiguationTest("a[b][c]",
|
||||
ExpressionType.EXPRESSION);
|
||||
test.disambiguationTest("a & b",
|
||||
ExpressionType.EXPRESSION);
|
||||
}
|
||||
|
||||
private final ParserFactory factory;
|
||||
|
||||
public DisambiguateParenthesizedPattern() {
|
||||
public DisambiguatePatterns() {
|
||||
Context context = new Context();
|
||||
JavacFileManager jfm = new JavacFileManager(context, true, Charset.defaultCharset());
|
||||
Options.instance(context).put(Option.PREVIEW, "");
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8268859
|
||||
* @summary Verify error recovery/disambiguation of case labels that mix expressions and patterns
|
||||
* @compile/fail/ref=PatternCaseErrorRecovery.out --enable-preview -source ${jdk.version} -XDrawDiagnostics PatternCaseErrorRecovery.java
|
||||
*/
|
||||
|
||||
public class PatternCaseErrorRecovery {
|
||||
Object expressionLikeType(Object o1, Object o2) {
|
||||
final int a = 1;
|
||||
final int b = 2;
|
||||
return switch (o1) {
|
||||
case true t -> o2;
|
||||
case 1 + 1 e -> o2;
|
||||
case a < b ? a : b e -> o2;
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
PatternCaseErrorRecovery.java:13:22: compiler.err.expected2: :, ->
|
||||
PatternCaseErrorRecovery.java:13:23: compiler.err.not.stmt
|
||||
PatternCaseErrorRecovery.java:14:23: compiler.err.expected2: :, ->
|
||||
PatternCaseErrorRecovery.java:14:24: compiler.err.not.stmt
|
||||
PatternCaseErrorRecovery.java:15:31: compiler.err.expected2: :, ->
|
||||
PatternCaseErrorRecovery.java:15:32: compiler.err.not.stmt
|
||||
6 errors
|
||||
@@ -0,0 +1,3 @@
|
||||
PatternErrorRecovery.java:12:18: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.pattern.switch)
|
||||
PatternErrorRecovery.java:11:18: compiler.err.const.expr.req
|
||||
2 errors
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8268320
|
||||
* @summary Verify user-friendly errors are reported for ill-formed pattern.
|
||||
* @compile/fail/ref=PatternErrorRecovery.out -XDrawDiagnostics -XDshould-stop.at=FLOW --enable-preview -source ${jdk.version} PatternErrorRecovery.java
|
||||
* @compile/fail/ref=PatternErrorRecovery-no-preview.out -XDrawDiagnostics -XDshould-stop.at=FLOW PatternErrorRecovery.java
|
||||
*/
|
||||
public class PatternErrorRecovery {
|
||||
void errorRecoveryNoPattern1(Object o) {
|
||||
switch (o) {
|
||||
case String: break;
|
||||
case Object obj: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
PatternErrorRecovery.java:11:18: compiler.err.pattern.expected
|
||||
- compiler.note.preview.filename: PatternErrorRecovery.java, DEFAULT
|
||||
- compiler.note.preview.recompile
|
||||
1 error
|
||||
@@ -76,7 +76,7 @@ public class SourceLevelChecks extends TestRunner {
|
||||
}
|
||||
}
|
||||
""",
|
||||
"Test.java:5:26: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.pattern.switch)",
|
||||
"Test.java:5:18: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.pattern.switch)",
|
||||
"1 error");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
SwitchErrors.java:35:31: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.pattern.switch)
|
||||
SwitchErrors.java:34:18: compiler.err.constant.label.not.compatible: java.lang.String, java.lang.Object
|
||||
SwitchErrors.java:40:18: compiler.err.constant.label.not.compatible: int, java.lang.Object
|
||||
SwitchErrors.java:46:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer)
|
||||
SwitchErrors.java:47:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.Integer, java.lang.CharSequence)
|
||||
SwitchErrors.java:52:18: compiler.err.preview.feature.disabled: (compiler.misc.feature.case.null)
|
||||
SwitchErrors.java:53:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, int)
|
||||
SwitchErrors.java:54:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: int, java.lang.CharSequence)
|
||||
SwitchErrors.java:60:20: compiler.err.total.pattern.and.default
|
||||
SwitchErrors.java:66:13: compiler.err.pattern.dominated
|
||||
SwitchErrors.java:72:18: compiler.err.total.pattern.and.default
|
||||
SwitchErrors.java:78:18: compiler.err.duplicate.total.pattern
|
||||
SwitchErrors.java:84:20: compiler.err.duplicate.default.label
|
||||
SwitchErrors.java:90:20: compiler.err.duplicate.default.label
|
||||
SwitchErrors.java:101:13: compiler.err.duplicate.case.label
|
||||
SwitchErrors.java:106:13: compiler.err.duplicate.case.label
|
||||
SwitchErrors.java:111:28: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:117:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:124:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:131:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:136:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer)
|
||||
SwitchErrors.java:142:18: compiler.err.instanceof.reifiable.not.safe: java.util.List, java.util.List<java.lang.Integer>
|
||||
SwitchErrors.java:148:18: compiler.err.cant.resolve.location: kindname.class, Undefined, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:155:18: compiler.err.type.found.req: int, (compiler.misc.type.req.class.array)
|
||||
SwitchErrors.java:172:27: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:178:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:184:13: compiler.err.pattern.dominated
|
||||
SwitchErrors.java:196:18: compiler.err.const.expr.req
|
||||
SwitchErrors.java:202:76: compiler.err.cant.resolve.location: kindname.variable, n, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:208:71: compiler.err.cant.resolve.location: kindname.variable, n, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:33:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:39:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:45:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:51:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:99:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:105:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:110:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:115:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:121:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:128:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:188:9: compiler.err.not.exhaustive.statement
|
||||
41 errors
|
||||
@@ -1,32 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8262891
|
||||
* @summary Verify errors related to pattern switches.
|
||||
* @compile/fail/ref=SwitchErrors.out --enable-preview -source ${jdk.version} -XDrawDiagnostics -XDshould-stop.at=FLOW SwitchErrors.java
|
||||
* @compile/fail/ref=SwitchErrors-no-preview.out -XDrawDiagnostics -XDshould-stop.at=FLOW SwitchErrors.java
|
||||
*/
|
||||
public class SwitchErrors {
|
||||
void incompatibleSelectorObjectString(Object o) {
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
SwitchErrors.java:34:18: compiler.err.constant.label.not.compatible: java.lang.String, java.lang.Object
|
||||
SwitchErrors.java:40:18: compiler.err.constant.label.not.compatible: int, java.lang.Object
|
||||
SwitchErrors.java:46:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer)
|
||||
SwitchErrors.java:47:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.Integer, java.lang.CharSequence)
|
||||
SwitchErrors.java:52:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.type.null, int)
|
||||
SwitchErrors.java:53:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, int)
|
||||
SwitchErrors.java:54:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: int, java.lang.CharSequence)
|
||||
SwitchErrors.java:60:20: compiler.err.total.pattern.and.default
|
||||
SwitchErrors.java:66:13: compiler.err.pattern.dominated
|
||||
SwitchErrors.java:66:24: compiler.err.total.pattern.and.default
|
||||
SwitchErrors.java:72:18: compiler.err.total.pattern.and.default
|
||||
SwitchErrors.java:78:18: compiler.err.duplicate.total.pattern
|
||||
SwitchErrors.java:84:20: compiler.err.duplicate.default.label
|
||||
SwitchErrors.java:90:20: compiler.err.duplicate.default.label
|
||||
SwitchErrors.java:95:27: compiler.err.duplicate.default.label
|
||||
SwitchErrors.java:101:13: compiler.err.duplicate.case.label
|
||||
SwitchErrors.java:106:13: compiler.err.duplicate.case.label
|
||||
SwitchErrors.java:111:28: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:117:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:124:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:131:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:136:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer)
|
||||
SwitchErrors.java:142:18: compiler.err.instanceof.reifiable.not.safe: java.util.List, java.util.List<java.lang.Integer>
|
||||
SwitchErrors.java:148:18: compiler.err.cant.resolve.location: kindname.class, Undefined, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:155:18: compiler.err.type.found.req: int, (compiler.misc.type.req.class.array)
|
||||
SwitchErrors.java:161:28: compiler.err.flows.through.from.pattern
|
||||
SwitchErrors.java:167:18: compiler.err.flows.through.from.pattern
|
||||
SwitchErrors.java:172:27: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:178:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:184:13: compiler.err.pattern.dominated
|
||||
SwitchErrors.java:196:18: compiler.err.pattern.expected
|
||||
SwitchErrors.java:202:76: compiler.err.cant.resolve.location: kindname.variable, n, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:208:71: compiler.err.cant.resolve.location: kindname.variable, n, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:33:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:39:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:45:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:51:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:99:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:105:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:110:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:115:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:121:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:128:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:188:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:10:18: compiler.err.constant.label.not.compatible: java.lang.String, java.lang.Object
|
||||
SwitchErrors.java:16:18: compiler.err.constant.label.not.compatible: int, java.lang.Object
|
||||
SwitchErrors.java:22:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer)
|
||||
SwitchErrors.java:23:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.Integer, java.lang.CharSequence)
|
||||
SwitchErrors.java:28:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.type.null, int)
|
||||
SwitchErrors.java:29:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, int)
|
||||
SwitchErrors.java:30:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: int, java.lang.CharSequence)
|
||||
SwitchErrors.java:36:20: compiler.err.total.pattern.and.default
|
||||
SwitchErrors.java:42:13: compiler.err.pattern.dominated
|
||||
SwitchErrors.java:42:24: compiler.err.total.pattern.and.default
|
||||
SwitchErrors.java:48:18: compiler.err.total.pattern.and.default
|
||||
SwitchErrors.java:54:18: compiler.err.duplicate.total.pattern
|
||||
SwitchErrors.java:60:20: compiler.err.duplicate.default.label
|
||||
SwitchErrors.java:66:20: compiler.err.duplicate.default.label
|
||||
SwitchErrors.java:71:27: compiler.err.duplicate.default.label
|
||||
SwitchErrors.java:77:13: compiler.err.duplicate.case.label
|
||||
SwitchErrors.java:82:13: compiler.err.duplicate.case.label
|
||||
SwitchErrors.java:87:28: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:93:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:100:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:107:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:112:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer)
|
||||
SwitchErrors.java:118:18: compiler.err.instanceof.reifiable.not.safe: java.util.List, java.util.List<java.lang.Integer>
|
||||
SwitchErrors.java:124:18: compiler.err.cant.resolve.location: kindname.class, Undefined, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:131:18: compiler.err.type.found.req: int, (compiler.misc.type.req.class.array)
|
||||
SwitchErrors.java:137:28: compiler.err.flows.through.from.pattern
|
||||
SwitchErrors.java:143:18: compiler.err.flows.through.from.pattern
|
||||
SwitchErrors.java:148:27: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:154:18: compiler.err.flows.through.to.pattern
|
||||
SwitchErrors.java:160:13: compiler.err.pattern.dominated
|
||||
SwitchErrors.java:172:18: compiler.err.pattern.expected
|
||||
SwitchErrors.java:178:76: compiler.err.cant.resolve.location: kindname.variable, n, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:184:71: compiler.err.cant.resolve.location: kindname.variable, n, , , (compiler.misc.location: kindname.class, SwitchErrors, null)
|
||||
SwitchErrors.java:9:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:15:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:21:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:27:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:75:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:81:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:86:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:91:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:97:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:104:9: compiler.err.not.exhaustive.statement
|
||||
SwitchErrors.java:164:9: compiler.err.not.exhaustive.statement
|
||||
- compiler.note.preview.filename: SwitchErrors.java, DEFAULT
|
||||
- compiler.note.preview.recompile
|
||||
44 errors
|
||||
|
||||
Reference in New Issue
Block a user