Skip to content

Stack overflow on member of some refined types. #2037

Closed
@nicolasstucki

Description

@nicolasstucki

The following type will generate a stack overflow when we call member on it.

   val badType =
      RefinedType(
        ctx.requiredClassRef("scala.collection.AbstractIterator"),
        "GroupedIterator".toTypeName,
        TypeRef(ctx.requiredClassRef("scala.collection.AbstractIterator"), "GroupedIterator".toTypeName))

    badType.member("GroupedIterator".toTypeName)

This a blocker for #1840 and only started happening after rebasing on the new bootstrap.

I have set up a simple test in this branch to reproduce the bug with sbt "testOnly dotc.tests".

Looking at the stack it is possible to see that it loops over glb making the types larger each time.

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