Skip to content

Recursion limit exceeded (opaque types + inline methods) (3.7.0) #23137

Open
@road21

Description

@road21

Compiler version

3.7.0
(works in 3.6.4)

Minimized code

//> using scala 3.7.0

object Foo:
    class Inner // moving Inner to external object fixes the error

    opaque type Type = Inner

    inline def of[A]: OfOps = new OfOps // type A is important here
    class OfOps:
        inline def apply(): Type = new Inner

@main def run: Unit = Foo.of()

Output

Compiler error:

[error] Recursion limit exceeded.
[error] Maybe there is an illegal cyclic reference?
[error] If that's not the case, you could also try to increase the stacksize using the -Xss JVM option.
[error] For the unprocessed stack trace, compile with -Xno-enrich-error-messages.
[error] A recurring operation is (inner to outer):
[error] 
[error]   find-member Foo.Inner
[error]   find-member Foo.Inner
[error]   find-member Foo.Inner
[error]   find-member Foo.Inner
[error]   find-member Foo.Inner
[error]   find-member Foo.Inner
[error]   find-member Foo.Inner

Expectation

No compiler error

Metadata

Metadata

Assignees

No one assigned

    Labels

    itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions