Skip to content
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

open object is allowed despite not doing anything #21760

Closed
KacperFKorban opened this issue Oct 14, 2024 · 2 comments · Fixed by #21922
Closed

open object is allowed despite not doing anything #21760

KacperFKorban opened this issue Oct 14, 2024 · 2 comments · Fixed by #21922
Assignees
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug Spree Suitable for a future Spree
Milestone

Comments

@KacperFKorban
Copy link
Member

Compiler version

3.6.1-RC1-bin-20241011-5e7ab15-NIGHTLY

Minimized code

//> using scala 3.nightly
  
open object O // no effect

Output

Successful compilation.

Expectation

Warning or error that open objects trivially cannot be extended.

Other info

This check should most likely be done in Desugar.scala#checkModifiers or somewhere in Checking.scala (maybe checkWellFormed)

@KacperFKorban KacperFKorban added itype:bug area:linting Linting warnings enabled with -W or -Xlint Spree Suitable for a future Spree labels Oct 14, 2024
@mbovel
Copy link
Member

mbovel commented Nov 9, 2024

This issue was picked for the Scala Issue Spree of Monday, November 11th. @SethTisue and @HarrisL2 will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

@SethTisue
Copy link
Member

sealed object errors in both Scala 2 and 3, so that seems like precedent that we should error on this too, since the combination is equally nonsensical (rather than merely redundant)

HarrisL2 added a commit to HarrisL2/scala3 that referenced this issue Nov 11, 2024
hamzaremmal added a commit that referenced this issue Nov 11, 2024
KacperFKorban pushed a commit to dotty-staging/dotty that referenced this issue Nov 20, 2024
@WojciechMazur WojciechMazur added this to the 3.6.3 milestone Nov 25, 2024
KacperFKorban pushed a commit to dotty-staging/dotty that referenced this issue Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug Spree Suitable for a future Spree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants