Skip to content

Commit 6f3aa3c

Browse files
committed
Handle corner case correctly
1 parent a8af838 commit 6f3aa3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
624624
*/
625625
def compareHkApply2(tp1: Type, tp2: HKApply, tycon2: Type, args2: List[Type]): Boolean = {
626626
val tparams = tycon2.typeParams
627-
if (tparams.isEmpty) return false // can happen for ill-typed programs, e.g. neg/tcpoly_overloaded.scala
627+
if (tparams.isEmpty) return tp1.isRef(NothingClass) // can happen for ill-typed programs, e.g. neg/tcpoly_overloaded.scala
628628

629629
/** True if `tp1` and `tp2` have compatible type constructors and their
630630
* corresponding arguments are subtypes relative to their variance (see `isSubArgs`).

0 commit comments

Comments
 (0)