Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions tests/neg/i2033.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import java.io._
import collection._
object Test {
def check(obj: AnyRef): Unit = {
val bos = new ByteArrayOutputStream()
val out = new ObjectOutputStream(println) // error
val arr = bos toByteArray ()
val in = (())
val deser = ()
val lhs = mutable LinkedHashSet ()
check(lhs)
}
}

// minimization
object Test2 {
class ObjectOutputStream(out: String) {
def this() = this("")
}
val out = new ObjectOutputStream(println) // error
}