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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling

def recurArgs(args1: List[Type], args2: List[Type], tparams2: List[ParamInfo]): Boolean =
if (args1.isEmpty) args2.isEmpty
else args2.nonEmpty && {
else args2.nonEmpty && tparams2.nonEmpty && {
val tparam = tparams2.head
val v = tparam.paramVarianceSign

Expand Down
14 changes: 14 additions & 0 deletions tests/neg/i12664.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
trait Step {
type Self
type Next[A]
}

trait DynamicNextStep {
type OneOf[Self, Next[_]]
def apply(s: Step): OneOf[s.Self, s.Next]
}

object X extends DynamicNextStep {
override type OneOf[Self] = Self // error
override def apply(s: Step) = ???
}