Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scf37 opened this issue Aug 1, 2021 · 0 comments · Fixed by #13232
Closed

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

scf37 opened this issue Aug 1, 2021 · 0 comments · Fixed by #13232
Assignees
Milestone

Comments

@scf37
Copy link

scf37 commented Aug 1, 2021

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.

@scf37 scf37 added the itype:bug label Aug 1, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Aug 2, 2021
@bishabosha bishabosha changed the title Symbol.children returns values for scala enum document that Symbol.children returns values for scala enum Aug 2, 2021
tanishiking pushed a commit to tanishiking/scala3 that referenced this issue Aug 10, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 10, 2022
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 16, 2022
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 10, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jul 6, 2023
@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 7, 2024
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants