aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-09-05 15:36:25 +0200
committerMartin Odersky <odersky@gmail.com>2013-09-05 15:37:57 +0200
commitf7ab848229e8b9b0de1b719725816209aa1271c8 (patch)
tree2d7ea759ed63413e8b6ac19cff8eea930797f412 /src/dotty/tools/dotc/typer
parent441613bd49f9b5629eefffdc30a52869c0732ca0 (diff)
downloaddotty-f7ab848229e8b9b0de1b719725816209aa1271c8.tar.gz
dotty-f7ab848229e8b9b0de1b719725816209aa1271c8.tar.bz2
dotty-f7ab848229e8b9b0de1b719725816209aa1271c8.zip
Several fixes in typer.
Also updated tests.
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala2
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 99e29fb30..8e3bb9dbb 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -713,7 +713,7 @@ trait Applications extends Compatibility { self: Typer =>
best :: asGood(alts1)
}
- private val dummyTree = untpd.Literal(Constant(null))
+ private lazy val dummyTree = untpd.Literal(Constant(null))
def dummyTreeOfType(tp: Type): Tree = dummyTree withTypeUnchecked tp
/** Resolve overloaded alternative `alts`, given expected type `pt`. */
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index dd07c921d..9815015c1 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1000,7 +1000,7 @@ class Typer extends Namer with Applications with Implicits {
i"""missing arguments for $methodStr
|follow this method with `_' if you want to treat it as a partially applied function""".stripMargin)
case _ =>
- if (typeConforms(tree.tpe, pt)) tree
+ if (tree.tpe <:< pt) tree
else if (ctx.mode is Mode.Pattern) tree // no subtype check for patterns
else if (ctx.mode is Mode.Type) err.typeMismatch(tree, pt)
else adaptToSubType(wtp)