diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-05 12:05:49 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-05 12:05:49 +0100 |
commit | c2f101a33ea7f89681d6b74731bbcff948e7e6da (patch) | |
tree | 52a67e7ea6001944ac2216c6e55e9dad9fe0b42f /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 8bb6ccae5c4f3ec91877fcfe032902f92aa5d2b4 (diff) | |
download | dotty-c2f101a33ea7f89681d6b74731bbcff948e7e6da.tar.gz dotty-c2f101a33ea7f89681d6b74731bbcff948e7e6da.tar.bz2 dotty-c2f101a33ea7f89681d6b74731bbcff948e7e6da.zip |
Changes to Desugar and Namer.
In particular: Changed the scheme to represent the types of setter parameters.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 6f5739396..fd97c2c22 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -619,18 +619,10 @@ class Typer extends Namer with Applications with Implicits { } def typedTypeTree(tree: untpd.TypeTree, pt: Type)(implicit ctx: Context): TypeTree = track("typedTypeTree") { - val (original1, ownType) = tree.original match { - case untpd.EmptyTree => - assert(isFullyDefined(pt, ForceDegree.none)) - (EmptyTree, pt) - case original: ValDef => - val meth = original.symbol // ??? was: symbolOfTree(original) TODO: come back to this - assert(meth.exists, meth) - (EmptyTree, meth.info) - case original => - val original1 = typed(original) - (original1, original1.tpe) - } + val original1 = typed(tree.original) + val ownType = + if (tree.original.isEmpty) { assert(isFullyDefined(pt, ForceDegree.none)); pt } + else original1.tpe cpy.TypeTree(tree, original1) withType ownType } @@ -1011,9 +1003,10 @@ class Typer extends Namer with Applications with Implicits { noMatches } case alts => + def all = if (altDenots.length == 2) "both" else "all" errorTree(tree, - i"""Ambiguous overload. The ${err.overloadedAltsStr(altDenots take 2)} - |both match $expectedStr""".stripMargin) + i"""Ambiguous overload. The ${err.overloadedAltsStr(altDenots)} + |$all match $expectedStr""".stripMargin) } } |