aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 64f44ee5e..dba95c689 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -621,10 +621,13 @@ trait Applications extends Compatibility { self: Typer =>
}
println(i"case 2 $unapplyArgType ${ctx.typerState.constraint}")
unapplyArgType
- } else errorType(
- i"Pattern type $unapplyArgType is neither a subtype nor a supertype of selector type $wpt",
- tree.pos)
-
+ } else {
+ // println("Neither sub nor super")
+ // println(TypeComparer.explained(implicit ctx => unapplyArgType <:< wpt))
+ errorType(
+ i"Pattern type $unapplyArgType is neither a subtype nor a supertype of selector type $wpt",
+ tree.pos)
+ }
var argTypes = unapplyArgs(mt.resultType)
val bunchedArgs = argTypes match {
case argType :: Nil if argType.isRepeatedParam => untpd.SeqLiteral(args) :: Nil
@@ -666,7 +669,7 @@ trait Applications extends Compatibility { self: Typer =>
isApplicable(methRef, args, resultType)
case _ =>
val app = tp.member(nme.apply)
- app.exists && app.hasAltWith(d => isApplicable(TermRef(tp, nme.apply).withDenot(d), args, resultType))
+ app.exists && app.hasAltWith(d => isApplicable(TermRef(tp, nme.apply, d), args, resultType))
}
/** In a set of overloaded applicable alternatives, is `alt1` at least as good as