diff options
author | Martin Odersky <odersky@gmail.com> | 2013-08-22 14:24:49 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-08-22 14:24:49 +0200 |
commit | 749934aeafecc65c865d92056467c08540add8cc (patch) | |
tree | 7b20ad103b0acb5b08f96c146a5a8c217a8e4b82 /src/dotty/tools/dotc/typer/Applications.scala | |
parent | cbcdbd6fb8c0bf372a61b4ddd5b6ce181964776d (diff) | |
download | dotty-749934aeafecc65c865d92056467c08540add8cc.tar.gz dotty-749934aeafecc65c865d92056467c08540add8cc.tar.bz2 dotty-749934aeafecc65c865d92056467c08540add8cc.zip |
More typer bug fixes and improvements in error messages
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Applications.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index 05b0c50ce..8af9e0b57 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -118,7 +118,8 @@ trait Applications extends Compatibility { self: Typer => case methType: MethodType => // apply the result type constraint, unless method type is dependent if (!methType.isDependent) - ok = ok && constrainResult(methType.resultType, resultType) + if (!constrainResult(methType.resultType, resultType)) + fail(err.typeMismatchStr(methType.resultType, resultType)) // match all arguments with corresponding formal parameters matchArgs(orderedArgs, methType.paramTypes, 0) case _ => @@ -484,7 +485,6 @@ trait Applications extends Compatibility { self: Typer => typed(assign) } - realApply if (untpd.isOpAssign(tree)) tryEither { implicit ctx => realApply @@ -706,7 +706,7 @@ trait Applications extends Compatibility { self: Typer => } private val dummyTree = untpd.Literal(Constant(null)) - def dummyTreeOfType(tp: Type): Tree = dummyTree withType tp + def dummyTreeOfType(tp: Type): Tree = dummyTree withTypeUnchecked tp /** Resolve overloaded alternative `alts`, given expected type `pt`. */ def resolveOverloaded(alts: List[TermRef], pt: Type)(implicit ctx: Context): List[TermRef] = { |