Permalink
Browse files

Mark pattern matcher synthetics as SYNTHETIC.

Flagging synthetics accurately is important to allow for
useful static analysis.
  • Loading branch information...
1 parent b02e952 commit 3177934fc157bb5e37797c87d20a25e2ff0311d1 @paulp paulp committed Nov 24, 2012
@@ -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)
@@ -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

0 comments on commit 3177934

Please sign in to comment.