Skip to content

StackOverflowError when defining a pseudo recursive type alias with identical lower and upper bounds #12599

Open
@noresttherein

Description

@noresttherein

Reproduction steps

Scala version: 2.13.7

type Fixed[F] >: F { type T >: Fixed[F] <: Fixed[F] } <: F { type T >: Fixed[F] <: Fixed[F] }

Problem

java.lang.StackOverflowError
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1540)
	at scala.reflect.internal.Types$TypeRef.baseType(Types.scala:2498)
	at scala.reflect.internal.tpe.TypeComparers.firstTry$1(TypeComparers.scala:473)
	at scala.reflect.internal.tpe.TypeComparers.isSubType2(TypeComparers.scala:615)
	at scala.reflect.internal.tpe.TypeComparers.isSubType1(TypeComparers.scala:347)
	at scala.reflect.internal.tpe.TypeComparers.isSubType(TypeComparers.scala:300)
	at scala.reflect.internal.tpe.TypeComparers.isSubType$(TypeComparers.scala:267)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:28)
	at scala.reflect.internal.tpe.TypeComparers.retry$4(TypeComparers.scala:589)
	at scala.reflect.internal.tpe.TypeComparers.abstractTypeOnLeft$1(TypeComparers.scala:590)
	at scala.reflect.internal.tpe.TypeComparers.fourthTry$1(TypeComparers.scala:605)
	at scala.reflect.internal.tpe.TypeComparers.classOnRight$1(TypeComparers.scala:529)
	at scala.reflect.internal.tpe.TypeComparers.thirdTryRef$1(TypeComparers.scala:533)
	at scala.reflect.internal.tpe.TypeComparers.firstTry$1(TypeComparers.scala:479)
	at scala.reflect.internal.tpe.TypeComparers.isSubType2(TypeComparers.scala:615)
	at scala.reflect.internal.tpe.TypeComparers.isSubType1(TypeComparers.scala:347)
	at scala.reflect.internal.tpe.TypeComparers.isSubType(TypeComparers.scala:300)
	at scala.reflect.internal.tpe.TypeComparers.isSubType$(TypeComparers.scala:267)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:28)

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler crashfixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions