Skip to content

document that Symbol.children returns values for scala enum #13230

Closed
@scf37

Description

@scf37

Compiler version

3.0.1

Minimized code

enum E:
  case A, B

val repr = TypeRepr.of[E]
TypeRepr.of[E].classSymbol.get.children // List(val A, val B)
repr.classSymbol.get.children.map { smb => repr.memberType(smb).show } // List(E, E)

Expectation

Technically scala enum is not a sealed hierarchy since all elements are val, not classes and have the same type.

I suspect it is a feature so Symbol.children scaladoc need to include this case.

Activity

added a commit that references this issue on Aug 2, 2021
10d6a8f
changed the title [-]Symbol.children returns values for scala enum[/-] [+]document that Symbol.children returns values for scala enum[/+] on Aug 2, 2021
added a commit that references this issue on Aug 10, 2021
539064e
added this to the 3.1.0 milestone on Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @scf37@nicolasstucki@Kordyjan@bishabosha

    Issue actions

      document that Symbol.children returns values for scala enum · Issue #13230 · scala/scala3