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
classTest {
defnewComponent(u: Universe): u.Component=???classUniverse { self =>classComponent
newComponent(this):this.Component// error, but should be fine since this is a stable reference
newComponent(self): self.Component// error, but should be fine since this is a stable reference
newComponent(self):this.Component// error, but should be fine since this is a stable reference
newComponent(this): self.Component// error, but should be fine since this is a stable referencevalu=this
newComponent(u): u.Component// ok
}
}
The text was updated successfully, but these errors were encountered:
Rich Oliver (rich oliver) said (edited on Jun 21, 2012 11:19:12 PM UTC):
When the bug is fixed could we have a clarification of what functionality self types support in terms of path dependant types. The self in the above examples is a simple this alias. But say we have:
class Outer {
val myInner: Inner
class Inner
}
class OtherA { selfA: Outer => }
class OtherB { selfB: Outer.myInner => }
class OtherC { selfC: Outer#Inner }
What should compile and if it will, can the compiler track the path dependant self references?
@adriaanm said:
please take clarification questions to scala-language, where everybody benefits (and you benefit from a bigger pool of potential answerererers)
this code should compile, but doesn't:
(from http://stackoverflow.com/questions/11110409/scala-path-dependent-return-type-from-parameter)
The text was updated successfully, but these errors were encountered: