diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2009-06-29 07:51:59 +0000 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2009-06-29 07:51:59 +0000 |
commit | 73a4bffc830d2ba3041dce199ea900f6b4ebd52a (patch) | |
tree | 9182755f5971d1a950ac300cb0de221243db0fc5 /src/compiler | |
parent | a868cd75895e239e20280e37c1d5e8dc81e5045a (diff) | |
download | scala-73a4bffc830d2ba3041dce199ea900f6b4ebd52a.tar.gz scala-73a4bffc830d2ba3041dce199ea900f6b4ebd52a.tar.bz2 scala-73a4bffc830d2ba3041dce199ea900f6b4ebd52a.zip |
fix #2103
Diffstat (limited to 'src/compiler')
-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) = { |