Last active
November 21, 2015 21:24
-
-
Save frozenspider/938991752d59d07927db to your computer and use it in GitHub Desktop.
self-recursive-type-failure.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Foo { self => | |
type SelfType <: Foo { | |
type SelfType = self.SelfType | |
} | |
} | |
// SelfType points to its child type | |
trait FooExtLvl1 extends Foo { | |
type SelfType = FooExtLvl2 | |
} | |
// SelfType points to own type | |
trait FooExtLvl2 extends FooExtLvl1 | |
// SelfType points to its parent type | |
trait FooExtLvl3 extends FooExtLvl2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment