aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-27 12:35:37 +0100
committerMartin Odersky <odersky@gmail.com>2017-02-27 13:22:24 +0100
commit145ac696c9a2cb26655e954b4a6be879a3500641 (patch)
tree8bd78d3adbdf513a3dcd74317078fee7d4e03d3a /compiler/src/dotty/tools/dotc/typer
parentd0162aed64def280af8aa812514d101c1563fc28 (diff)
downloaddotty-145ac696c9a2cb26655e954b4a6be879a3500641.tar.gz
dotty-145ac696c9a2cb26655e954b4a6be879a3500641.tar.bz2
dotty-145ac696c9a2cb26655e954b4a6be879a3500641.zip
Fix #2033: Improve handling of unresolved overloaded arguments
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Applications.scala11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala
index de017961a..e9df12b42 100644
--- a/compiler/src/dotty/tools/dotc/typer/Applications.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala
@@ -450,7 +450,16 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
def typedArg(arg: Arg, formal: Type): Arg = arg
def addArg(arg: TypedArg, formal: Type) =
- ok = ok & isCompatible(argType(arg, formal), formal)
+ ok = ok & {
+ argType(arg, formal) match {
+ case ref: TermRef if ref.denot.isOverloaded =>
+ // in this case we could not resolve overloading because no alternative
+ // matches expected type
+ false
+ case argtpe =>
+ isCompatible(argtpe, formal)
+ }
+ }
def makeVarArg(n: Int, elemFormal: Type) = {}
def fail(msg: => Message, arg: Arg) =
ok = false