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

Refinements containing traits or classes are not properly handled. #436

Closed
scabug opened this issue Feb 4, 2008 · 5 comments
Closed

Refinements containing traits or classes are not properly handled. #436

scabug opened this issue Feb 4, 2008 · 5 comments

Comments

@scabug
Copy link

scabug commented Feb 4, 2008

scala> class X
defined class X

scala> val y = new X { val y = 3 }
y: X{def y: Int} = $$anon$$1@1f44aa6

scala> val z = new X { type Y = String }
z: X{type Y = String} = $$anon$$1@1b561a2

scala> val z = new X { trait Z }
z: X = $$anon$$1@48ff68
@scabug
Copy link
Author

scabug commented Feb 4, 2008

Imported From: https://issues.scala-lang.org/browse/SI-436?orig=1
Reporter: Geoffrey Alan Washburn (washburn)

@scabug
Copy link
Author

scabug commented Feb 4, 2008

Geoffrey Alan Washburn (washburn) said:

scala> val w = new X { class Z }
w: X = $$anon$$1@200d0c

@scabug
Copy link
Author

scabug commented Feb 4, 2008

Geoffrey Alan Washburn (washburn) said:
Okay, I see that this must occur because the grammar of refinements (3.2.7 SLS) does not include class or trait declarations. Is there a reason for this restriction?

@scabug
Copy link
Author

scabug commented Feb 7, 2008

Geoffrey Alan Washburn (washburn) said:
Per the discussion at this week's Scala meeting, this is mostly to avoid having to deal with trait and class overrides. Perhaps revisit once virtual classes are in place, but I do not think our virtual class translation would work here.

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone 2.7.0 deleted

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

1 participant