mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Document failure to handle type parameter shadowing
This commit is contained in:
parent
b09d2277b8
commit
fe015ef30f
@ -565,6 +565,15 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
}`);
|
||||
// This test is descriptive, rather than normative. The current implementation
|
||||
// doesn't handle type parameter shadowing.
|
||||
testExtractMethod("extractMethod14",
|
||||
`function F<T>(t1: T) {
|
||||
function F<T>(t2: T) {
|
||||
[#|t1.toString();
|
||||
t2.toString();|]
|
||||
}
|
||||
}`);
|
||||
});
|
||||
|
||||
|
||||
39
tests/baselines/reference/extractMethod/extractMethod14.ts
Normal file
39
tests/baselines/reference/extractMethod/extractMethod14.ts
Normal file
@ -0,0 +1,39 @@
|
||||
// ==ORIGINAL==
|
||||
function F<T>(t1: T) {
|
||||
function F<T>(t2: T) {
|
||||
t1.toString();
|
||||
t2.toString();
|
||||
}
|
||||
}
|
||||
// ==SCOPE::function 'F'==
|
||||
function F<T>(t1: T) {
|
||||
function F<T>(t2: T) {
|
||||
newFunction();
|
||||
|
||||
function newFunction() {
|
||||
t1.toString();
|
||||
t2.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
// ==SCOPE::function 'F'==
|
||||
function F<T>(t1: T) {
|
||||
function F<T>(t2: T) {
|
||||
newFunction<T>(t2);
|
||||
}
|
||||
|
||||
function newFunction<T>(t2: T) {
|
||||
t1.toString();
|
||||
t2.toString();
|
||||
}
|
||||
}
|
||||
// ==SCOPE::global scope==
|
||||
function F<T>(t1: T) {
|
||||
function F<T>(t2: T) {
|
||||
newFunction<T, T>(t1, t2);
|
||||
}
|
||||
}
|
||||
function newFunction<T, T>(t1: T, t2: T) {
|
||||
t1.toString();
|
||||
t2.toString();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user