Skip to content

StackOverflow in typer #4368

Closed
Closed
@sir-wabbit

Description

@sir-wabbit
trait X {
  type A = B
  type B
}
trait Y {
  type A
  type B = A
}
trait Z extends X with Y
Exception in thread "main" java.lang.StackOverflowError
	at java.lang.invoke.MemberName.getInvocationType(MemberName.java:164)
	at java.lang.invoke.DirectMethodHandle.preparedLambdaForm(DirectMethodHandle.java:167)
	at java.lang.invoke.DirectMethodHandle.make(DirectMethodHandle.java:89)
	at java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:1660)
	at java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:1617)
	at java.lang.invoke.MethodHandles$Lookup.getDirectMethodForConstant(MethodHandles.java:1802)
	at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1751)
	at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:661)
	at dotty.tools.dotc.core.Types$Type.memberExcluding(Types.scala:491)
	at dotty.tools.dotc.core.Types$Type.$anonfun$nonPrivateMember$1(Types.scala:482)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
	at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:482)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:1777)
	at dotty.tools.dotc.core.Types$NamedType.reload$1(Types.scala:2025)
	at dotty.tools.dotc.core.Types$NamedType.withPrefix(Types.scala:2037)
	at dotty.tools.dotc.core.Types$NamedType.derivedSelect(Types.scala:1997)
	at dotty.tools.dotc.core.Types$TypeMap.derivedSelect(Types.scala:3902)
	at dotty.tools.dotc.core.Types$ApproximatingTypeMap.derivedSelect(Types.scala:4174)
	at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.$anonfun$apply$4(TypeOps.scala:61)
	at dotty.tools.dotc.reporting.trace$.op1$1(trace.scala:18)
	at dotty.tools.dotc.reporting.trace$.conditionally(trace.scala:20)
	at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.apply(TypeOps.scala:54)
	at dotty.tools.dotc.core.Types$TypeMap.$anonfun$mapOver$7(Types.scala:3974)
	at dotty.tools.dotc.core.Types$VariantTraversal.atVariance(Types.scala:3888)
	at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:3974)
	at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.$anonfun$apply$4(TypeOps.scala:67)
	at dotty.tools.dotc.reporting.trace$.op1$1(trace.scala:18)
	at dotty.tools.dotc.reporting.trace$.conditionally(trace.scala:20)
	at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.apply(TypeOps.scala:54)
	at dotty.tools.dotc.core.TypeOps.asSeenFrom(TypeOps.scala:28)
	at dotty.tools.dotc.core.TypeOps.asSeenFrom$(TypeOps.scala:27)
	at dotty.tools.dotc.core.Contexts$Context.asSeenFrom(Contexts.scala:71)
	at dotty.tools.dotc.core.Types$Type.$anonfun$asSeenFrom$1(Types.scala:767)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
	at dotty.tools.dotc.core.Types$Type.asSeenFrom(Types.scala:766)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.computeAsSeenFrom(Denotations.scala:1075)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.computeAsSeenFrom(Denotations.scala:660)
	at dotty.tools.dotc.core.Denotations$PreDenotation.asSeenFrom(Denotations.scala:131)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.mapInherited(Denotations.scala:1062)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.mapInherited(Denotations.scala:660)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1605)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1600)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.collect$1(SymDenotations.scala:1600)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.$anonfun$computeNPMembersNamed$1(SymDenotations.scala:1613)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.computeNPMembersNamed(SymDenotations.scala:1592)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.nonPrivateMembersNamed(SymDenotations.scala:1582)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.findMember(SymDenotations.scala:1617)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:509)
	at dotty.tools.dotc.core.Types$Type.goThis$1(Types.scala:613)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:522)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:658)
	at dotty.tools.dotc.core.Types$Type.memberExcluding(Types.scala:491)
	at dotty.tools.dotc.core.Types$Type.$anonfun$nonPrivateMember$1(Types.scala:482)
	at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
	at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:482)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:1777)
	at dotty.tools.dotc.core.Types$NamedType.reload$1(Types.scala:2025)
	at dotty.tools.dotc.core.Types$NamedType.withPrefix(Types.scala:2037)
	at dotty.tools.dotc.core.Types$NamedType.derivedSelect(Types.scala:1997)
	at dotty.tools.dotc.core.Types$TypeMap.derivedSelect(Types.scala:3902)
	at dotty.tools.dotc.core.Types$ApproximatingTypeMap.derivedSelect(Types.scala:4174)
	at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.$anonfun$apply$4(TypeOps.scala:61)
	at dotty.tools.dotc.reporting.trace$.op1$1(trace.scala:18)
	at dotty.tools.dotc.reporting.trace$.conditionally(trace.scala:20)
	at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.apply(TypeOps.scala:54)
	at dotty.tools.dotc.core.Types$TypeMap.$anonfun$mapOver$7(Types.scala:3974)
	at dotty.tools.dotc.core.Types$VariantTraversal.atVariance(Types.scala:3888)
	at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:3974)
	at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.$anonfun$apply$4(TypeOps.scala:67)
	at dotty.tools.dotc.reporting.trace$.op1$1(trace.scala:18)
	at dotty.tools.dotc.reporting.trace$.conditionally(trace.scala:20)
.......

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions