20 lines
445 B
Text
20 lines
445 B
Text
=== tests/cases/compiler/typedGenericPrototypeMember.ts ===
|
|
class List<T> {
|
|
>List : List<T>
|
|
>T : T
|
|
|
|
add(item: T) { }
|
|
>add : (item: T) => void
|
|
>item : T
|
|
>T : T
|
|
}
|
|
|
|
List.prototype.add("abc"); // Valid because T is instantiated to any
|
|
>List.prototype.add("abc") : void
|
|
>List.prototype.add : (item: any) => void
|
|
>List.prototype : List<any>
|
|
>List : typeof List
|
|
>prototype : List<any>
|
|
>add : (item: any) => void
|
|
>"abc" : string
|
|
|