Created
October 5, 2018 07:18
-
-
Save S2/ea5865999ec658c9b313731168c0a542 to your computer and use it in GitHub Desktop.
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
class AAA{ | |
constructor(){ | |
console.log("aaa") | |
} | |
} | |
class XXX{ | |
} | |
class BBB extends XXX{ | |
constructor(){ | |
super() | |
console.log("bbb") | |
} | |
} | |
class CCC extends XXX{ | |
constructor(){ | |
super() | |
console.log("ccc") | |
} | |
} | |
class Hoge<A , B extends BBB|CCC>{ | |
constructor(public a : A , public b : B){ | |
console.log("XXXXX") | |
} | |
} | |
class Fuga<B> extends Hoge<AAA , B>{} | |
class Fuga1<B> extends Fuga<B>{} | |
class Fuga2<B> extends Fuga<B>{} | |
class Fuga3<B> extends Fuga<B>{} | |
class Fuga4 extends Fuga<BBB>{} | |
interface Piyo{ | |
a : {new<B extends XXX>(p : AAA , q : B) :Fuga<B>} | |
} | |
class Bar implements Piyo{ | |
a = Fuga1 | |
constructor(){ | |
new this.a(new AAA() , new AAA()) // error? | |
new this.a(new AAA() , new BBB()) | |
new this.a(new AAA() , new CCC()) | |
} | |
} | |
new Bar() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment