5a7500ca5e
This is important for incremental parsing, as it is where we can attach parse errors at the end of the file to. Also, it helps with things like emitting comments at the end of the file.
58 lines
1.2 KiB
JavaScript
58 lines
1.2 KiB
JavaScript
//// [innerTypeParameterShadowingOuterOne.ts]
|
|
// inner type parameters shadow outer ones of the same name
|
|
// no errors expected
|
|
|
|
function f<T extends Date>() {
|
|
function g<T extends Number>() {
|
|
var x: T;
|
|
x.toFixed();
|
|
}
|
|
var x: T;
|
|
x.getDate();
|
|
}
|
|
|
|
function f2<T extends Date, U extends Date>() {
|
|
function g<T extends Number, U extends Number>() {
|
|
var x: U;
|
|
x.toFixed();
|
|
}
|
|
var x: U;
|
|
x.getDate();
|
|
}
|
|
//function f2<T extends Date, U extends T>() {
|
|
// function g<T extends Number, U extends T>() {
|
|
// var x: U;
|
|
// x.toFixed();
|
|
// }
|
|
// var x: U;
|
|
// x.getDate();
|
|
//}
|
|
|
|
//// [innerTypeParameterShadowingOuterOne.js]
|
|
// inner type parameters shadow outer ones of the same name
|
|
// no errors expected
|
|
function f() {
|
|
function g() {
|
|
var x;
|
|
x.toFixed();
|
|
}
|
|
var x;
|
|
x.getDate();
|
|
}
|
|
function f2() {
|
|
function g() {
|
|
var x;
|
|
x.toFixed();
|
|
}
|
|
var x;
|
|
x.getDate();
|
|
}
|
|
//function f2<T extends Date, U extends T>() {
|
|
// function g<T extends Number, U extends T>() {
|
|
// var x: U;
|
|
// x.toFixed();
|
|
// }
|
|
// var x: U;
|
|
// x.getDate();
|
|
//}
|