2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/constraintCheckInGenericBaseTypeReference.ts ===
|
|
|
|
// No errors
|
|
|
|
class Constraint {
|
2015-04-16 01:44:20 +02:00
|
|
|
>Constraint : Constraint
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public method() { }
|
2015-04-16 01:44:20 +02:00
|
|
|
>method : () => void
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
class GenericBase<T extends Constraint> {
|
2015-04-16 01:44:20 +02:00
|
|
|
>GenericBase : GenericBase<T>
|
|
|
|
>T : T
|
|
|
|
>Constraint : Constraint
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public items: any;
|
2015-04-16 01:44:20 +02:00
|
|
|
>items : any
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
class Derived extends GenericBase<TypeArg> {
|
2015-04-16 01:44:20 +02:00
|
|
|
>Derived : Derived
|
2015-06-16 15:55:52 +02:00
|
|
|
>GenericBase : GenericBase<TypeArg>
|
2015-04-16 01:44:20 +02:00
|
|
|
>TypeArg : TypeArg
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
class TypeArg {
|
2015-04-16 01:44:20 +02:00
|
|
|
>TypeArg : TypeArg
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public method() {
|
2015-04-16 01:44:20 +02:00
|
|
|
>method : () => void
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
Container.People.items;
|
2015-04-16 01:44:20 +02:00
|
|
|
>Container.People.items : any
|
|
|
|
>Container.People : Derived
|
|
|
|
>Container : typeof Container
|
|
|
|
>People : Derived
|
|
|
|
>items : any
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class Container {
|
2015-04-16 01:44:20 +02:00
|
|
|
>Container : Container
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public static People: Derived
|
2015-04-16 01:44:20 +02:00
|
|
|
>People : Derived
|
|
|
|
>Derived : Derived
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|