* Always generate type & symbol baselines * Accept changed shadowed baselines * Accept brand new type and symbol baselines * Allow `getTypeAtLocation` to return undefined in the type writer * Accept baselines which had missing type information * Bind container for dynamically names enum members so they may be printed * Accept type/symbol baselines for enums with computed members * First pass at reducing typeWriter memory overhead * Use generators to allow for type and symbol baselines with no cache * Accept new baselines for tests whose output was fixed by better newline splitting * Hard cap on number of declarations printed, cache declaration print text * handle differing newlines better still to handle RWC newlines * Lower abridging count, accept abridged baselines * Limit max RWC error output size, limit RWC type and symbol baseline input size * Move skip logic into type and symbol baseliner to streamline error handling * Accept removal of empty baselines * Canonicalize path earlier to handle odd paths in input files * Do canonicalization earlier still, also ensure parallel perf profiles for different targets do not trample one another * No need to pathify again
89 lines
2.4 KiB
Plaintext
89 lines
2.4 KiB
Plaintext
=== tests/cases/conformance/types/localTypes/localTypes4.ts ===
|
|
function f1() {
|
|
>f1 : Symbol(f1, Decl(localTypes4.ts, 0, 0))
|
|
|
|
// Type parameters are in scope in parameters and return types
|
|
function f<T>(x: T): T {
|
|
>f : Symbol(f, Decl(localTypes4.ts, 0, 15))
|
|
>T : Symbol(T, Decl(localTypes4.ts, 2, 15))
|
|
>x : Symbol(x, Decl(localTypes4.ts, 2, 18))
|
|
>T : Symbol(T, Decl(localTypes4.ts, 2, 15))
|
|
>T : Symbol(T, Decl(localTypes4.ts, 2, 15))
|
|
|
|
return undefined;
|
|
>undefined : Symbol(undefined)
|
|
}
|
|
}
|
|
|
|
function f2() {
|
|
>f2 : Symbol(f2, Decl(localTypes4.ts, 5, 1))
|
|
|
|
// Local types are not in scope in parameters and return types
|
|
function f(x: T): T {
|
|
>f : Symbol(f, Decl(localTypes4.ts, 7, 15))
|
|
>x : Symbol(x, Decl(localTypes4.ts, 9, 15))
|
|
|
|
interface T { }
|
|
>T : Symbol(T, Decl(localTypes4.ts, 9, 25))
|
|
|
|
return undefined;
|
|
>undefined : Symbol(undefined)
|
|
}
|
|
}
|
|
|
|
function f3() {
|
|
>f3 : Symbol(f3, Decl(localTypes4.ts, 13, 1))
|
|
|
|
// Type parameters and top-level local types are in same declaration space
|
|
function f<T>() {
|
|
>f : Symbol(f, Decl(localTypes4.ts, 15, 15))
|
|
>T : Symbol(T, Decl(localTypes4.ts, 17, 15))
|
|
|
|
interface T { }
|
|
>T : Symbol(T, Decl(localTypes4.ts, 17, 21))
|
|
|
|
return undefined;
|
|
>undefined : Symbol(undefined)
|
|
}
|
|
}
|
|
|
|
function f4() {
|
|
>f4 : Symbol(f4, Decl(localTypes4.ts, 21, 1))
|
|
|
|
// Local types are block scoped
|
|
interface T { x: number }
|
|
>T : Symbol(T, Decl(localTypes4.ts, 23, 15))
|
|
>x : Symbol(T.x, Decl(localTypes4.ts, 25, 17))
|
|
|
|
let v: T;
|
|
>v : Symbol(v, Decl(localTypes4.ts, 26, 7))
|
|
>T : Symbol(T, Decl(localTypes4.ts, 23, 15))
|
|
|
|
v.x = 10;
|
|
>v.x : Symbol(T.x, Decl(localTypes4.ts, 25, 17))
|
|
>v : Symbol(v, Decl(localTypes4.ts, 26, 7))
|
|
>x : Symbol(T.x, Decl(localTypes4.ts, 25, 17))
|
|
|
|
if (true) {
|
|
interface T { x: string }
|
|
>T : Symbol(T, Decl(localTypes4.ts, 28, 15))
|
|
>x : Symbol(T.x, Decl(localTypes4.ts, 29, 21))
|
|
|
|
let v: T;
|
|
>v : Symbol(v, Decl(localTypes4.ts, 30, 11))
|
|
>T : Symbol(T, Decl(localTypes4.ts, 28, 15))
|
|
|
|
v.x = "hello";
|
|
>v.x : Symbol(T.x, Decl(localTypes4.ts, 29, 21))
|
|
>v : Symbol(v, Decl(localTypes4.ts, 30, 11))
|
|
>x : Symbol(T.x, Decl(localTypes4.ts, 29, 21))
|
|
}
|
|
else {
|
|
v.x = 20;
|
|
>v.x : Symbol(T.x, Decl(localTypes4.ts, 25, 17))
|
|
>v : Symbol(v, Decl(localTypes4.ts, 26, 7))
|
|
>x : Symbol(T.x, Decl(localTypes4.ts, 25, 17))
|
|
}
|
|
}
|
|
|