Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Mark pattern matcher synthetics as SYNTHETIC.

Flagging synthetics accurately is important to allow for
useful static analysis.
  • Loading branch information...
commit 3177934fc157bb5e37797c87d20a25e2ff0311d1 1 parent b02e952
@paulp paulp authored
2  src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -369,7 +369,7 @@ abstract class UnCurry extends InfoTransform
val isDefinedAtMethodDef = {
- val methSym = anonClass.newMethod(nme.isDefinedAt, fun.pos, FINAL)
+ val methSym = anonClass.newMethod(nme.isDefinedAt, fun.pos, FINAL | SYNTHETIC)
val params = methSym newSyntheticValueParams formals
methSym setInfoAndEnter MethodType(params, BooleanClass.tpe)
2  src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
@@ -1405,7 +1405,7 @@ trait PatternMatching extends Transform with TypingTransformers with ast.TreeDSL
// assert(owner ne null); assert(owner ne NoSymbol)
def freshSym(pos: Position, tp: Type = NoType, prefix: String = "x") =
- NoSymbol.newTermSymbol(freshName(prefix), pos) setInfo tp
+ NoSymbol.newTermSymbol(freshName(prefix), pos, newFlags = SYNTHETIC) setInfo tp
def newSynthCaseLabel(name: String) =
NoSymbol.newLabel(freshName(name), NoPosition) setFlag treeInfo.SYNTH_CASE_FLAGS
Please sign in to comment.
Something went wrong with that request. Please try again.