You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
traitFoo {
self: bar.type=>finalclassV(valx:Int) extendsAnyVal// ./a.scala:4: error: value class may not be a member of another class// final class V(val x: Int) extends AnyVal// ^// one error found
}
objectbarextendsFoo { }
This should compile, else we are robbed of all the mechanisms by which one normally can partition a large object into its constituent parts.
The text was updated successfully, but these errors were encountered:
@adriaanm said (edited on Jul 3, 2012 4:07:00 PM UTC):
This would be hard to spec: "a class with a self type that's a singleton type referring to an accessible symbol does not need an outer pointer, and may thus serve as an outer class of a value class (which cannot accommodate an outer pointer)".
Instead, it seems more likely that we'll at one point support multi-field value classes,
only to then realize that the outer pointer is in fact not needed here and fall back to single-field value class.
(I hope I correctly paraphrased Martin's thoughts from today's meeting.)
@paulp said:
Right now the spec says "C is either a toplevel class or is a member of a statically accessible object." In what sense is V not a member of a statically accessible object? If there is a V, is V not a member of bar, the statically accessible object?
@paulp said:
I'm not sure by what route this ended up on the blockers for 2.10.0 list, but as the opener, I say it can certainly wait. (Nor does it look especially easy to fix, at least not in the face of separate compilation.)
This should compile, else we are robbed of all the mechanisms by which one normally can partition a large object into its constituent parts.
The text was updated successfully, but these errors were encountered: