Skip to content

Commit b02e952

Browse files
committed
Set symbol flags at creation.
All should prefer passing flags at symbol creation to mutating the flags field after creation.
1 parent 5b498a2 commit b02e952

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL
11431143

11441144
// ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix` by `Select(q, outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix`
11451145
// if there's an outer accessor, otherwise the condition becomes `true` -- TODO: can we improve needsOuterTest so there's always an outerAccessor?
1146-
val outer = expectedTp.typeSymbol.newMethod(vpmName.outer) setInfo expectedTp.prefix setFlag SYNTHETIC | ARTIFACT
1146+
val outer = expectedTp.typeSymbol.newMethod(vpmName.outer, newFlags = SYNTHETIC | ARTIFACT) setInfo expectedTp.prefix
11471147

11481148
(Select(codegen._asInstanceOf(testedBinder, expectedTp), outer)) OBJ_EQ expectedOuter
11491149
}
@@ -3601,7 +3601,7 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL
36013601
*/
36023602
def matcher(scrut: Tree, scrutSym: Symbol, restpe: Type)(cases: List[Casegen => Tree], matchFailGen: Option[Tree => Tree]): Tree = {
36033603
val matchEnd = newSynthCaseLabel("matchEnd")
3604-
val matchRes = NoSymbol.newValueParameter(newTermName("x"), NoPosition, SYNTHETIC) setInfo restpe.withoutAnnotations
3604+
val matchRes = NoSymbol.newValueParameter(newTermName("x"), NoPosition, newFlags = SYNTHETIC) setInfo restpe.withoutAnnotations
36053605
matchEnd setInfo MethodType(List(matchRes), restpe)
36063606

36073607
def newCaseSym = newSynthCaseLabel("case") setInfo MethodType(Nil, restpe)

0 commit comments

Comments
 (0)