diff options
author | Martin Odersky <odersky@gmail.com> | 2008-05-02 14:55:17 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-05-02 14:55:17 +0000 |
commit | 76c76b28f952584210fd851f95877b84f0b688a2 (patch) | |
tree | 20dfff67c5d7d092104fd17c66cb597e1c9327b7 /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | 8c35b8f863e5b7104deb7bfdce957d6d428cc25f (diff) | |
download | scala-76c76b28f952584210fd851f95877b84f0b688a2.tar.gz scala-76c76b28f952584210fd851f95877b84f0b688a2.tar.bz2 scala-76c76b28f952584210fd851f95877b84f0b688a2.zip |
fixed #828, #789, #828.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index dcaea1041b..10d226ace2 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -569,7 +569,10 @@ trait Namers { self: Analyzer => } else { enterValueParams(meth, vparamss) } - if (tpt.isEmpty && meth.name == nme.CONSTRUCTOR) tpt.tpe = context.enclClass.owner.tpe + if (tpt.isEmpty && meth.name == nme.CONSTRUCTOR) { + tpt.tpe = context.enclClass.owner.tpe + tpt setPos meth.pos + } if (onlyPresentation) methodArgumentNames(meth) = vparamss.map(_.map(_.symbol)); @@ -673,6 +676,7 @@ trait Namers { self: Analyzer => for (vparam <- vparams) { if (vparam.tpt.isEmpty) { vparam.tpt.tpe = pfs.head + vparam.tpt setPos vparam.pos vparam.symbol setInfo pfs.head } pfs = pfs.tail @@ -705,9 +709,10 @@ trait Namers { self: Analyzer => if (tpt.isEmpty) { val pt = resultPt.substSym(tparamSyms, tparams map (_.symbol)) tpt.tpe = widenIfNotFinal(meth, typer.computeType(rhs, pt), pt) + tpt setPos meth.pos tpt.tpe } else typer.typedType(tpt).tpe) - } + } /** If `sym' is an implicit value, check that its type signature `tp' is contractive. * This means: The type of every implicit parameter is properly contained @@ -840,6 +845,7 @@ trait Namers { self: Analyzer => sym, newTyper(typer1.context.make(vdef, sym)).computeType(rhs, WildcardType), WildcardType) + tpt setPos vdef.pos tpt.tpe } } else typer1.typedType(tpt).tpe @@ -947,6 +953,7 @@ trait Namers { self: Analyzer => checkNoConflict(FINAL, SEALED) checkNoConflict(PRIVATE, PROTECTED) checkNoConflict(PRIVATE, OVERRIDE) + //checkNoConflict(PRIVATE, FINAL) // can't do this because FINAL also means compile-time constant checkNoConflict(DEFERRED, FINAL) } } |