Skip to content

Commit e5a4b3e

Browse files
committed
Pattern bound symbols should have Case flag
1 parent 791c75a commit e5a4b3e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class ExpandSAMs extends MiniPhase {
124124
def translateMatch(tree: Match, pfParam: Symbol, cases: List[CaseDef], defaultValue: Tree)(implicit ctx: Context) = {
125125
val selector = tree.selector
126126
val selectorTpe = selector.tpe.widen
127-
val defaultSym = ctx.newSymbol(pfParam.owner, nme.WILDCARD, Synthetic, selectorTpe)
127+
val defaultSym = ctx.newSymbol(pfParam.owner, nme.WILDCARD, Synthetic | Case, selectorTpe)
128128
val defaultCase =
129129
CaseDef(
130130
Bind(defaultSym, Underscore(selectorTpe)),

compiler/src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
336336
}
337337

338338
val retryCase = {
339-
val caseSymbol = ctx.newSymbol(methodSymbol, nme.DEFAULT_EXCEPTION_NAME, Synthetic, defn.ThrowableType)
339+
val caseSymbol = ctx.newSymbol(methodSymbol, nme.DEFAULT_EXCEPTION_NAME, Synthetic | Case, defn.ThrowableType)
340340
val triggerRetry = setFlagState.appliedTo(thiz, offset, initState, fieldId)
341341
CaseDef(
342342
Bind(caseSymbol, ref(caseSymbol)),

compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class NonLocalReturns extends MiniPhase {
6969
*/
7070
private def nonLocalReturnTry(body: Tree, key: TermSymbol, meth: Symbol)(implicit ctx: Context) = {
7171
val keyDef = ValDef(key, New(defn.ObjectType, Nil))
72-
val ex = ctx.newSymbol(meth, nme.ex, EmptyFlags, nonLocalReturnControl, coord = body.span)
72+
val ex = ctx.newSymbol(meth, nme.ex, Case, nonLocalReturnControl, coord = body.span)
7373
val pat = BindTyped(ex, nonLocalReturnControl)
7474
val rhs = If(
7575
ref(ex).select(nme.key).appliedToNone.select(nme.eq).appliedTo(ref(key)),

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class TreeChecker extends Phase with SymTransformer {
185185
assert(
186186
patternBound(sym),
187187
"patBoundSyms.contains(sym) => patternBound(sym) is broken." +
188-
" Pattern bound symbol has incorrect flags: " + sym.flags + ", line " + sym.sourcePos.line
188+
i" Pattern bound symbol $sym has incorrect flags: " + sym.flagsString + ", line " + sym.sourcePos.line
189189
)
190190
}
191191
patBoundSyms ++= syms
@@ -215,7 +215,7 @@ class TreeChecker extends Phase with SymTransformer {
215215
if (!ctx.phase.patternTranslated)
216216
assert(
217217
!patternBound(sym) || patBoundSyms.contains(sym),
218-
"patternBound(sym) => patBoundSyms.contains(sym) is broken, line " + tree.sourcePos.line
218+
i"patternBound(sym) => patBoundSyms.contains(sym) is broken, sym = $sym, line " + tree.sourcePos.line
219219
)
220220
}
221221

0 commit comments

Comments
 (0)