Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2021-09-22 06:42:58 +0000
committerJay Arthanareeswaran2021-10-26 05:35:10 +0000
commit00529f6ffb3d3c5fa77054fa4cb5e158c01fd0d9 (patch)
treea7d0d45b244ed6bdc9249126362026f391b9ccb3
parentf8768b6899a6a2ccc560388e8854ed8a3391ad7e (diff)
downloadeclipse.jdt.core-00529f6ffb3d3c5fa77054fa4cb5e158c01fd0d9.tar.gz
eclipse.jdt.core-00529f6ffb3d3c5fa77054fa4cb5e158c01fd0d9.tar.xz
eclipse.jdt.core-00529f6ffb3d3c5fa77054fa4cb5e158c01fd0d9.zip
Bug 576093 - Switch on enum causes VerifyError: Bad type on operandP20211026-0140BETA_JAVA17
stack Change-Id: Ia059b30ad0e6f4be17379f5c15273fbd0b39e92d Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com> Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/185688 Tested-by: JDT Bot <jdt-bot@eclipse.org> (cherry picked from commit 805fb5849ab3de166270aa38361f3017f07e54cb) Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/186174
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
index 61931d95bf..089960d58a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
@@ -787,6 +787,7 @@ public class SwitchStatement extends Expression {
CompilerOptions compilerOptions = upperScope.compilerOptions();
boolean isEnhanced = checkAndSetEnhanced(upperScope, expressionType);
if (expressionType != null) {
+ this.expression.computeConversion(upperScope, expressionType, expressionType);
checkType: {
if (!expressionType.isValidBinding()) {
expressionType = null; // fault-tolerance: ignore type mismatch from constants from hereon

Back to the top