Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2021-09-22 06:42:58 +0000
committerJay Arthanareeswaran2021-09-22 07:56:25 +0000
commit805fb5849ab3de166270aa38361f3017f07e54cb (patch)
treec96021c723ffd13a51d55f3c7c5d3eb2d95c6959
parent72c206c046e77c4139d6101eee427aa67cf19ddd (diff)
downloadeclipse.jdt.core-805fb5849ab3de166270aa38361f3017f07e54cb.tar.gz
eclipse.jdt.core-805fb5849ab3de166270aa38361f3017f07e54cb.tar.xz
eclipse.jdt.core-805fb5849ab3de166270aa38361f3017f07e54cb.zip
Bug 576093 - Switch on enum causes VerifyError: Bad type on operandI20210922-1800
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>
-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