Skip to content

enum inside macro impl #9902

Closed
Closed
@rnd4222

Description

@rnd4222

Minimized code

    enum T:
      case N
      case C(i: Int, t: T)
    T.C(1, T.C(2, T.N))

Output

[error]    |  Exception occurred while executing macro expansion.
[error]    |  java.lang.StackOverflowError

Expectation

When this example is defined in a regular code, it works fine.
When used inside of a macro implementation, it causes StackOverflow.
Workaround is to replace case N with case N() or replace enum with a sealed trait hierarchy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions