Skip to content

Merge multiple parameter lists in resolveOverloaded #11369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ trait Applications extends Compatibility {
def skip(tp: Type): Type = tp match {
case tp: PolyType =>
val rt = skip(tp.resultType)
if (rt.exists) tp.derivedLambdaType(resType = rt) else rt
if rt.exists then tp.derivedLambdaType(resType = rt).asInstanceOf[PolyType].flatten else rt
case tp: MethodType =>
tp.instantiate(argTypes)
case _ =>
Expand Down Expand Up @@ -1974,7 +1974,7 @@ trait Applications extends Compatibility {
None
}
val mapped = reverseMapping.map(_._1)
overload.println(i"resolve mapped: $mapped")
overload.println(i"resolve mapped: ${mapped.map(_.widen)}%, % with $pt")
resolveOverloaded(mapped, pt).map(reverseMapping.toMap)

/** Try to typecheck any arguments in `pt` that are function values missing a
Expand Down
8 changes: 8 additions & 0 deletions tests/pos/i11358.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
object Test:

def test1: IArray[Int] = IArray(1, 2) +++ IArray(2, 3)
def test2: IArray[Int] = IArray(1, 2) +++ List(2, 3)

extension [A: reflect.ClassTag](arr: IArray[A])
def +++[B >: A: reflect.ClassTag](suffix: IArray[B]): IArray[B] = ???
def +++[B >: A: reflect.ClassTag](suffix: IterableOnce[B]): IArray[B] = ???