Skip to content

Commit 3177934

Browse files
committed
Mark pattern matcher synthetics as SYNTHETIC.
Flagging synthetics accurately is important to allow for useful static analysis.
1 parent b02e952 commit 3177934

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/scala/tools/nsc/transform/UnCurry.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ abstract class UnCurry extends InfoTransform
369369
}
370370

371371
val isDefinedAtMethodDef = {
372-
val methSym = anonClass.newMethod(nme.isDefinedAt, fun.pos, FINAL)
372+
val methSym = anonClass.newMethod(nme.isDefinedAt, fun.pos, FINAL | SYNTHETIC)
373373
val params = methSym newSyntheticValueParams formals
374374
methSym setInfoAndEnter MethodType(params, BooleanClass.tpe)
375375

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL
14051405

14061406
// assert(owner ne null); assert(owner ne NoSymbol)
14071407
def freshSym(pos: Position, tp: Type = NoType, prefix: String = "x") =
1408-
NoSymbol.newTermSymbol(freshName(prefix), pos) setInfo tp
1408+
NoSymbol.newTermSymbol(freshName(prefix), pos, newFlags = SYNTHETIC) setInfo tp
14091409

14101410
def newSynthCaseLabel(name: String) =
14111411
NoSymbol.newLabel(freshName(name), NoPosition) setFlag treeInfo.SYNTH_CASE_FLAGS

0 commit comments

Comments
 (0)