File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -147,8 +147,9 @@ class FirstTransform extends MiniPhase with InfoTransformer { thisPhase =>
147
147
if (tree.isType) {
148
148
toTypeTree(tree)
149
149
} else if (tree.name != nme.WILDCARD ) {
150
- // Constant-foldable wildcards can occur in patterns, for instance as `case _: "a"`
151
- // we avoid constant-folding those as doing so would change the meaning of the pattern
150
+ // We want to constant-fold _some_ idents here - for instance, @switch needs to see literals in patterns.
151
+ // However, constant-foldable wildcards can occur in patterns, for instance as `case _: "a"`;
152
+ // we avoid constant-folding those as doing so would change the meaning of the pattern.
152
153
constToLiteral(tree)
153
154
} else tree
154
155
You can’t perform that action at this time.
0 commit comments