diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/Trees.scala | 6 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 12 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala index 6741a8bea5..662f3c9908 100644 --- a/src/compiler/scala/tools/nsc/ast/Trees.scala +++ b/src/compiler/scala/tools/nsc/ast/Trees.scala @@ -1101,8 +1101,10 @@ trait Trees { new ArrayValue(elemtpt, trees).copyAttrs(tree) def Function(tree: Tree, vparams: List[ValDef], body: Tree) = new Function(vparams, body).copyAttrs(tree) - def Assign(tree: Tree, lhs: Tree, rhs: Tree) = - new Assign(lhs, rhs).copyAttrs(tree) + def Assign(tree: Tree, lhs: Tree, rhs: Tree) = tree match { + case t: AssignOrNamedArg => new AssignOrNamedArg(lhs, rhs).copyAttrs(tree) + case _ => new Assign(lhs, rhs).copyAttrs(tree) + } def If(tree: Tree, cond: Tree, thenp: Tree, elsep: Tree) = new If(cond, thenp, elsep).copyAttrs(tree) def Match(tree: Tree, selector: Tree, cases: List[CaseDef]) = diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index d91f680123..90a680a514 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2253,21 +2253,13 @@ trait Typers { self: Analyzer => } } - def typedAnnotation(constr: Tree): AnnotationInfo = - typedAnnotation(constr, EXPRmode) - - def typedAnnotation(constr: Tree, mode: Int): AnnotationInfo = - typedAnnotation(constr, mode, NoSymbol) - - def typedAnnotation(constr: Tree, mode: Int, selfsym: Symbol): AnnotationInfo = - typedAnnotation(constr, mode, selfsym, AnnotationClass, false) - /** * Convert an annotation constructor call into an AnnotationInfo. * * @param annClass the expected annotation class */ - def typedAnnotation(ann: Tree, mode: Int, selfsym: Symbol, annClass: Symbol, requireJava: Boolean): AnnotationInfo = { + def typedAnnotation(ann: Tree, mode: Int = EXPRmode, selfsym: Symbol = NoSymbol, + annClass: Symbol = AnnotationClass, requireJava: Boolean = false): AnnotationInfo = { lazy val annotationError = AnnotationInfo(ErrorType, Nil, Nil) var hasError: Boolean = false def error(pos: Position, msg: String) = { |