File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -450,7 +450,16 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
450450
451451 def typedArg (arg : Arg , formal : Type ): Arg = arg
452452 def addArg (arg : TypedArg , formal : Type ) =
453- ok = ok & isCompatible(argType(arg, formal), formal)
453+ ok = ok & {
454+ argType(arg, formal) match {
455+ case ref : TermRef if ref.denot.isOverloaded =>
456+ // in this case we could not resolve overloading because no alternative
457+ // matches expected type
458+ false
459+ case argtpe =>
460+ isCompatible(argtpe, formal)
461+ }
462+ }
454463 def makeVarArg (n : Int , elemFormal : Type ) = {}
455464 def fail (msg : => Message , arg : Arg ) =
456465 ok = false
Original file line number Diff line number Diff line change 1+ import java .io ._
2+ import collection ._
3+ object Test {
4+ def check (obj : AnyRef ): Unit = {
5+ val bos = new ByteArrayOutputStream ()
6+ val out = new ObjectOutputStream (println) // error
7+ val arr = bos toByteArray ()
8+ val in = (())
9+ val deser = ()
10+ val lhs = mutable LinkedHashSet ()
11+ check(lhs)
12+ }
13+ }
14+
15+ // minimization
16+ object Test2 {
17+ class ObjectOutputStream (out : String ) {
18+ def this () = this (" " )
19+ }
20+ val out = new ObjectOutputStream (println) // error
21+ }
You can’t perform that action at this time.
0 commit comments