Skip to content

Disallow definitions in refinements #246

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
smarter opened this issue Nov 26, 2014 · 1 comment
Closed

Disallow definitions in refinements #246

smarter opened this issue Nov 26, 2014 · 1 comment

Comments

@smarter
Copy link
Member

smarter commented Nov 26, 2014

The following should not compile:

object O {
  class A { def f: Int = 0 }
  type X = A { def f: Int = 1 }
}

CC @odersky

@Blaisorblade
Copy link
Contributor

Fixed this year (with tests) in 33e6ca1.

scala> object O {
     |   class A { def f: Int = 0 }
     |   type X = A { def f: Int = 1 }
     | }
3 |  type X = A { def f: Int = 1 }
  |               ^^^^^^^^^^^^^^
  |               illegal refinement

tgodzik added a commit to tgodzik/scala3 that referenced this issue Apr 29, 2025
Backport "Use by-name parameter for Properties.*OrElse " to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants