aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-10-23 21:15:21 +0200
committerMartin Odersky <odersky@gmail.com>2013-10-23 21:15:21 +0200
commit344f0444ac708e4ee885deeb54d070924487fa31 (patch)
tree303690451f79f7a9b9890f8aeabbc7dff33dab02
parent7cf397d00073db9af8a74495610bf124ac0689cf (diff)
downloaddotty-344f0444ac708e4ee885deeb54d070924487fa31.tar.gz
dotty-344f0444ac708e4ee885deeb54d070924487fa31.tar.bz2
dotty-344f0444ac708e4ee885deeb54d070924487fa31.zip
Suppressing type error messages against prototypes.
Found/expected type errors are no longer produced if the expected type is a prototype. Instead we return the tree without adaptation and wait for the error to be produced in the next step, where the error mesage tends to be better.
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 11de19648..840bee467 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1072,8 +1072,11 @@ class Typer extends Namer with Applications with Implicits {
}
// try an implicit conversion
inferView(tree, pt) match {
- case SearchSuccess(adapted) => adapted
- case failure: SearchFailure => err.typeMismatch(tree, pt, failure)
+ case SearchSuccess(adapted) =>
+ adapted
+ case failure: SearchFailure =>
+ if (pt.isInstanceOf[ProtoType]) tree
+ else err.typeMismatch(tree, pt, failure)
}
}