Test:deferred mapped types

This commit is contained in:
Nathan Shively-Sanders 2018-01-03 15:54:43 -08:00
parent 8616170060
commit 81a601bb49
7 changed files with 97 additions and 8 deletions

View File

@ -2066,6 +2066,7 @@ declare namespace ts {
EvolvingArray = 256,
ObjectLiteralPatternWithComputedProperties = 512,
ContainsSpread = 1024,
Deferred = 2048,
ClassOrInterface = 3,
}
interface ObjectType extends Type {

View File

@ -2066,6 +2066,7 @@ declare namespace ts {
EvolvingArray = 256,
ObjectLiteralPatternWithComputedProperties = 512,
ContainsSpread = 1024,
Deferred = 2048,
ClassOrInterface = 3,
}
interface ObjectType extends Type {

View File

@ -391,15 +391,15 @@ function f6(s: string) {
});
let v = unboxify(b);
>v : { [x: string]: string | number | boolean; }
>unboxify(b) : { [x: string]: string | number | boolean; }
>v : {}
>unboxify(b) : {}
>unboxify : <T>(obj: Boxified<T>) => T
>b : { [x: string]: Box<number> | Box<string> | Box<boolean>; }
let x: string | number | boolean = v[s];
>x : string | number | boolean
>v[s] : string | number | boolean
>v : { [x: string]: string | number | boolean; }
>v : {}
>s : string
}

View File

@ -8,6 +8,14 @@ out.a
out.a.a
out.a.a.a.a.a.a.a
interface B { [s: string]: B }
declare let b: B;
const oub = foo(b);
oub.b
oub.b.b
oub.b.a.n.a.n.a
let xhr: XMLHttpRequest;
const out2 = foo(xhr);
out2.responseXML
@ -19,6 +27,10 @@ var out = foo(a);
out.a;
out.a.a;
out.a.a.a.a.a.a.a;
var oub = foo(b);
oub.b;
oub.b.b;
oub.b.a.n.a.n.a;
var xhr;
var out2 = foo(xhr);
out2.responseXML;

View File

@ -59,18 +59,42 @@ out.a.a.a.a.a.a.a
>a : Symbol(a, Decl(mappedTypeRecursiveInference.ts, 0, 13))
>a : Symbol(a, Decl(mappedTypeRecursiveInference.ts, 0, 13))
interface B { [s: string]: B }
>B : Symbol(B, Decl(mappedTypeRecursiveInference.ts, 7, 17))
>s : Symbol(s, Decl(mappedTypeRecursiveInference.ts, 10, 15))
>B : Symbol(B, Decl(mappedTypeRecursiveInference.ts, 7, 17))
declare let b: B;
>b : Symbol(b, Decl(mappedTypeRecursiveInference.ts, 11, 11))
>B : Symbol(B, Decl(mappedTypeRecursiveInference.ts, 7, 17))
const oub = foo(b);
>oub : Symbol(oub, Decl(mappedTypeRecursiveInference.ts, 12, 5))
>foo : Symbol(foo, Decl(mappedTypeRecursiveInference.ts, 2, 45))
>b : Symbol(b, Decl(mappedTypeRecursiveInference.ts, 11, 11))
oub.b
>oub : Symbol(oub, Decl(mappedTypeRecursiveInference.ts, 12, 5))
oub.b.b
>oub : Symbol(oub, Decl(mappedTypeRecursiveInference.ts, 12, 5))
oub.b.a.n.a.n.a
>oub : Symbol(oub, Decl(mappedTypeRecursiveInference.ts, 12, 5))
let xhr: XMLHttpRequest;
>xhr : Symbol(xhr, Decl(mappedTypeRecursiveInference.ts, 9, 3))
>xhr : Symbol(xhr, Decl(mappedTypeRecursiveInference.ts, 17, 3))
>XMLHttpRequest : Symbol(XMLHttpRequest, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
const out2 = foo(xhr);
>out2 : Symbol(out2, Decl(mappedTypeRecursiveInference.ts, 10, 5))
>out2 : Symbol(out2, Decl(mappedTypeRecursiveInference.ts, 18, 5))
>foo : Symbol(foo, Decl(mappedTypeRecursiveInference.ts, 2, 45))
>xhr : Symbol(xhr, Decl(mappedTypeRecursiveInference.ts, 9, 3))
>xhr : Symbol(xhr, Decl(mappedTypeRecursiveInference.ts, 17, 3))
out2.responseXML
>out2.responseXML : Symbol(responseXML, Decl(lib.dom.d.ts, --, --))
>out2 : Symbol(out2, Decl(mappedTypeRecursiveInference.ts, 10, 5))
>out2 : Symbol(out2, Decl(mappedTypeRecursiveInference.ts, 18, 5))
>responseXML : Symbol(responseXML, Decl(lib.dom.d.ts, --, --))
out2.responseXML.activeElement.className.length
@ -78,7 +102,7 @@ out2.responseXML.activeElement.className.length
>out2.responseXML.activeElement.className : Symbol(className, Decl(lib.dom.d.ts, --, --))
>out2.responseXML.activeElement : Symbol(activeElement, Decl(lib.dom.d.ts, --, --))
>out2.responseXML : Symbol(responseXML, Decl(lib.dom.d.ts, --, --))
>out2 : Symbol(out2, Decl(mappedTypeRecursiveInference.ts, 10, 5))
>out2 : Symbol(out2, Decl(mappedTypeRecursiveInference.ts, 18, 5))
>responseXML : Symbol(responseXML, Decl(lib.dom.d.ts, --, --))
>activeElement : Symbol(activeElement, Decl(lib.dom.d.ts, --, --))
>className : Symbol(className, Decl(lib.dom.d.ts, --, --))

View File

@ -60,6 +60,49 @@ out.a.a.a.a.a.a.a
>a : { a: {}; }
>a : { a: {}; }
interface B { [s: string]: B }
>B : B
>s : string
>B : B
declare let b: B;
>b : B
>B : B
const oub = foo(b);
>oub : {}
>foo(b) : {}
>foo : <T>(deep: Deep<T>) => T
>b : B
oub.b
>oub.b : {}
>oub : {}
>b : {}
oub.b.b
>oub.b.b : {}
>oub.b : {}
>oub : {}
>b : {}
>b : {}
oub.b.a.n.a.n.a
>oub.b.a.n.a.n.a : {}
>oub.b.a.n.a.n : {}
>oub.b.a.n.a : {}
>oub.b.a.n : {}
>oub.b.a : {}
>oub.b : {}
>oub : {}
>b : {}
>a : {}
>n : {}
>a : {}
>n : {}
>a : {}
let xhr: XMLHttpRequest;
>xhr : XMLHttpRequest
>XMLHttpRequest : XMLHttpRequest

View File

@ -8,6 +8,14 @@ out.a
out.a.a
out.a.a.a.a.a.a.a
interface B { [s: string]: B }
declare let b: B;
const oub = foo(b);
oub.b
oub.b.b
oub.b.a.n.a.n.a
let xhr: XMLHttpRequest;
const out2 = foo(xhr);
out2.responseXML