Created
July 11, 2020 14:40
-
-
Save y2k/6422c651c3f1e3593c38e83d1eaa220f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
open class OpenClass | |
class FirstOpenClass : OpenClass() | |
class SecondOpenClass : OpenClass() | |
class Foo<TGen : OpenClass>( | |
val open: TGen = FirstOpenClass() as TGen | |
) { | |
companion object { | |
fun build() = Foo(FirstOpenClass()) //it’s OK | |
} | |
} | |
val a: SecondOpenClass = Foo<SecondOpenClass>().open |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment