Bug 575241 - [17] switch block covering a type T - Follow-up
Change-Id: I041d8c3a57ba110f065324f9f861322dee588b7c
Signed-off-by: Manoj Palat <manpalat@in.ibm.com>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/183919
Tested-by: JDT Bot <jdt-bot@eclipse.org>
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 ad8f599..7f42f17 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
@@ -966,8 +966,7 @@
private void addSecretPatternSwitchVariables(BlockScope upperScope) {
if (this.containsPatterns) {
this.scope = new BlockScope(upperScope);
- TypeBinding type = this.expression.resolvedType.clone(this.expression.resolvedType.enclosingType());
- this.dispatchPatternCopy = new LocalVariableBinding(SecretPatternVariableName, type, ClassFileConstants.AccDefault, false);
+ this.dispatchPatternCopy = new LocalVariableBinding(SecretPatternVariableName, this.expression.resolvedType, ClassFileConstants.AccDefault, false);
this.scope.addLocalVariable(this.dispatchPatternCopy);
this.dispatchPatternCopy.setConstant(Constant.NotAConstant);
this.dispatchPatternCopy.useFlag = LocalVariableBinding.USED;