91 lines
1.6 KiB
Plaintext
91 lines
1.6 KiB
Plaintext
|
=== tests/cases/conformance/types/typeParameters/typeParameterLists/innerTypeParameterShadowingOuterOne2.ts ===
|
||
|
// inner type parameters shadow outer ones of the same name
|
||
|
// no errors expected
|
||
|
|
||
|
class C<T extends Date> {
|
||
|
>C : C<T>
|
||
|
>T : T
|
||
|
>Date : Date
|
||
|
|
||
|
g<T extends Number>() {
|
||
|
>g : <T extends Number>() => void
|
||
|
>T : T
|
||
|
>Number : Number
|
||
|
|
||
|
var x: T;
|
||
|
>x : T
|
||
|
>T : T
|
||
|
|
||
|
x.toFixed();
|
||
|
>x.toFixed() : string
|
||
|
>x.toFixed : (fractionDigits?: number) => string
|
||
|
>x : T
|
||
|
>toFixed : (fractionDigits?: number) => string
|
||
|
}
|
||
|
|
||
|
h() {
|
||
|
>h : () => void
|
||
|
|
||
|
var x: T;
|
||
|
>x : T
|
||
|
>T : T
|
||
|
|
||
|
x.getDate();
|
||
|
>x.getDate() : number
|
||
|
>x.getDate : () => number
|
||
|
>x : T
|
||
|
>getDate : () => number
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class C2<T extends Date, U extends Date> {
|
||
|
>C2 : C2<T, U>
|
||
|
>T : T
|
||
|
>Date : Date
|
||
|
>U : U
|
||
|
>Date : Date
|
||
|
|
||
|
g<T extends Number, U extends Number>() {
|
||
|
>g : <T extends Number, U extends Number>() => void
|
||
|
>T : T
|
||
|
>Number : Number
|
||
|
>U : U
|
||
|
>Number : Number
|
||
|
|
||
|
var x: U;
|
||
|
>x : U
|
||
|
>U : U
|
||
|
|
||
|
x.toFixed();
|
||
|
>x.toFixed() : string
|
||
|
>x.toFixed : (fractionDigits?: number) => string
|
||
|
>x : U
|
||
|
>toFixed : (fractionDigits?: number) => string
|
||
|
}
|
||
|
|
||
|
h() {
|
||
|
>h : () => void
|
||
|
|
||
|
var x: U;
|
||
|
>x : U
|
||
|
>U : U
|
||
|
|
||
|
x.getDate();
|
||
|
>x.getDate() : number
|
||
|
>x.getDate : () => number
|
||
|
>x : U
|
||
|
>getDate : () => number
|
||
|
}
|
||
|
}
|
||
|
//class C2<T extends Date, U extends T> {
|
||
|
// g<T extends Number, U extends T>() {
|
||
|
// var x: U;
|
||
|
// x.toFixed();
|
||
|
// }
|
||
|
|
||
|
// h() {
|
||
|
// var x: U;
|
||
|
// x.getDate();
|
||
|
// }
|
||
|
//}
|