2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/genericPrototypeProperty2.ts ===
|
|
|
|
interface EventTarget { x }
|
|
|
|
>EventTarget : EventTarget
|
|
|
|
>x : any
|
|
|
|
|
|
|
|
class BaseEvent {
|
|
|
|
>BaseEvent : BaseEvent
|
|
|
|
|
|
|
|
target: EventTarget;
|
|
|
|
>target : EventTarget
|
|
|
|
>EventTarget : EventTarget
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyEvent<T extends EventTarget> extends BaseEvent {
|
|
|
|
>MyEvent : MyEvent<T>
|
|
|
|
>T : T
|
|
|
|
>EventTarget : EventTarget
|
|
|
|
>BaseEvent : BaseEvent
|
|
|
|
|
|
|
|
target: T;
|
|
|
|
>target : T
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
class BaseEventWrapper {
|
|
|
|
>BaseEventWrapper : BaseEventWrapper
|
|
|
|
|
|
|
|
t: BaseEvent;
|
|
|
|
>t : BaseEvent
|
|
|
|
>BaseEvent : BaseEvent
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyEventWrapper extends BaseEventWrapper {
|
|
|
|
>MyEventWrapper : MyEventWrapper
|
|
|
|
>BaseEventWrapper : BaseEventWrapper
|
|
|
|
|
|
|
|
t: MyEvent<any>; // any satisfies constraint and passes assignability check between 'target' properties
|
|
|
|
>t : MyEvent<any>
|
2014-08-19 04:56:03 +02:00
|
|
|
>MyEvent : MyEvent<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|