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 =>
147147 if (tree.isType) {
148148 toTypeTree(tree)
149149 } 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.
152153 constToLiteral(tree)
153154 } else tree
154155
You can’t perform that action at this time.
0 commit comments