mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Test:XMLHttpRequest inference to PartialDeep<T>
Compilation didn't finish before! Now it does.
This commit is contained in:
1 parent
05de0a7da3
commit
6b024f6495
4 files changed
+28
No files matched your search
@@ -4,7 +4,12 @@ declare let a: A;
|
||||
type Deep<T> = { [K in keyof T]: Deep<T[K]> }
|
||||
declare function foo<T>(deep: Deep<T>): T;
|
||||
const out = foo(a);
|
||||
|
||||
let xhr: XMLHttpRequest;
|
||||
const out2 = foo(xhr);
|
||||
|
||||
|
||||
//// [mappedTypeRecursiveInference.js]
|
||||
var out = foo(a);
|
||||
var xhr;
|
||||
var out2 = foo(xhr);
|
||||
@@ -30,3 +30,12 @@ const out = foo(a);
|
||||
>foo : Symbol(foo, Decl(mappedTypeRecursiveInference.ts, 2, 45))
|
||||
>a : Symbol(a, Decl(mappedTypeRecursiveInference.ts, 1, 11))
|
||||
|
||||
let xhr: XMLHttpRequest;
|
||||
>xhr : Symbol(xhr, Decl(mappedTypeRecursiveInference.ts, 6, 3))
|
||||
>XMLHttpRequest : Symbol(XMLHttpRequest, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
|
||||
const out2 = foo(xhr);
|
||||
>out2 : Symbol(out2, Decl(mappedTypeRecursiveInference.ts, 7, 5))
|
||||
>foo : Symbol(foo, Decl(mappedTypeRecursiveInference.ts, 2, 45))
|
||||
>xhr : Symbol(xhr, Decl(mappedTypeRecursiveInference.ts, 6, 3))
|
||||
|
||||
@@ -31,3 +31,13 @@ const out = foo(a);
|
||||
>foo : <T>(deep: Deep<T>) => T
|
||||
>a : A
|
||||
|
||||
let xhr: XMLHttpRequest;
|
||||
>xhr : XMLHttpRequest
|
||||
>XMLHttpRequest : XMLHttpRequest
|
||||
|
||||
const out2 = foo(xhr);
|
||||
>out2 : { onreadystatechange: {}; readonly readyState: { toString: {}; toFixed: {}; toExponential: {}; toPrecision: {}; valueOf: {}; toLocaleString: {}; }; readonly response: {}; readonly responseText: { toString: {}; charAt: {}; charCodeAt: {}; concat: {}; indexOf: {}; lastIndexOf: {}; localeCompare: {}; match: {}; replace: {}; search: {}; slice: {}; split: {}; substring: {}; toLowerCase: {}; toLocaleLowerCase: {}; toUpperCase: {}; toLocaleUpperCase: {}; trim: {}; readonly length: {}; substr: {}; valueOf: {}; [Symbol.iterator]: {}; codePointAt: {}; includes: {}; endsWith: {}; normalize: {}; repeat: {}; startsWith: {}; anchor: {}; big: {}; blink: {}; bold: {}; fixed: {}; fontcolor: {}; fontsize: {}; italics: {}; link: {}; small: {}; strike: {}; sub: {}; sup: {}; }; responseType: {}; readonly responseURL: {}; readonly responseXML: { readonly activeElement: { readonly classList: { readonly length: {}; add: {}; contains: {}; item: {}; remove: {}; toggle: {}; toString: {}; }; className: {}; readonly clientHeight: {}; readonly clientLeft: {}; readonly clientTop: {}; readonly clientWidth: {}; id: {}; innerHTML: {}; msContentZoomFactor: {}; readonly msRegionOverflow: {}; onariarequest: {}; oncommand: {}; ongotpointercapture: {}; onlostpointercapture: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsgotpointercapture: {}; onmsinertiastart: {}; onmslostpointercapture: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; outerHTML: {}; readonly prefix: {}; readonly scrollHeight: {}; scrollLeft: {}; scrollTop: {}; readonly scrollWidth: {}; readonly tagName: {}; readonly assignedSlot: { name: {}; assignedNodes: {}; accessKey: {}; readonly children: { namedItem: {}; readonly length: {}; item: {}; }; contentEditable: {}; readonly dataset: { [x: string]: {}; }; dir: {}; draggable: { valueOf: {}; }; hidden: {}; hideFocus: {}; innerText: {}; readonly isContentEditable: {}; lang: {}; readonly offsetHeight: {}; readonly offsetLeft: {}; readonly offsetParent: {}; readonly offsetTop: {}; readonly offsetWidth: {}; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforecopy: {}; onbeforecut: {}; onbeforedeactivate: {}; onbeforepaste: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; oncopy: {}; oncuechange: {}; oncut: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmouseenter: {}; onmouseleave: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsmanipulationstatechanged: {}; onpaste: {}; onpause: {}; onplay: {}; onplaying: {}; onprogress: {}; onratechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectstart: {}; onstalled: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; onvolumechange: {}; onwaiting: {}; outerText: {}; spellcheck: {}; readonly style: { alignContent: {}; alignItems: {}; alignmentBaseline: {}; alignSelf: {}; animation: {}; animationDelay: {}; animationDirection: {}; animationDuration: {}; animationFillMode: {}; animationIterationCount: {}; animationName: {}; animationPlayState: {}; animationTimingFunction: {}; backfaceVisibility: {}; background: {}; backgroundAttachment: {}; backgroundClip: {}; backgroundColor: {}; backgroundImage: {}; backgroundOrigin: {}; backgroundPosition: {}; backgroundPositionX: {}; backgroundPositionY: {}; backgroundRepeat: {}; backgroundSize: {}; baselineShift: {}; border: {}; borderBottom: {}; borderBottomColor: {}; borderBottomLeftRadius: {}; borderBottomRightRadius: {}; borderBottomStyle: {}; borderBottomWidth: {}; borderCollapse: {}; borderColor: {}; borderImage: {}; borderImageOutset: {}; borderImageRepeat: {}; borderImageSlice: {}; borderImageSource: {}; borderImageWidth: {}; borderLeft: {}; borderLeftColor: {}; borderLeftStyle: {}; borderLeftWidth: {}; borderRadius: {}; borderRight: {}; borderRightColor: {}; borderRightStyle: {}; borderRightWidth: {}; borderSpacing: {}; borderStyle: {}; borderTop: {}; borderTopColor: {}; borderTopLeftRadius: {}; borderTopRightRadius: {}; borderTopStyle: {}; borderTopWidth: {}; borderWidth: {}; bottom: {}; boxShadow: {}; boxSizing: {}; breakAfter: {}; breakBefore: {}; breakInside: {}; captionSide: {}; clear: {}; clip: {}; clipPath: {}; clipRule: {}; color: {}; colorInterpolationFilters: {}; columnCount: {}; columnFill: {}; columnGap: {}; coluLine truncated
|
||||
>foo(xhr) : { onreadystatechange: {}; readonly readyState: { toString: {}; toFixed: {}; toExponential: {}; toPrecision: {}; valueOf: {}; toLocaleString: {}; }; readonly response: {}; readonly responseText: { toString: {}; charAt: {}; charCodeAt: {}; concat: {}; indexOf: {}; lastIndexOf: {}; localeCompare: {}; match: {}; replace: {}; search: {}; slice: {}; split: {}; substring: {}; toLowerCase: {}; toLocaleLowerCase: {}; toUpperCase: {}; toLocaleUpperCase: {}; trim: {}; readonly length: {}; substr: {}; valueOf: {}; [Symbol.iterator]: {}; codePointAt: {}; includes: {}; endsWith: {}; normalize: {}; repeat: {}; startsWith: {}; anchor: {}; big: {}; blink: {}; bold: {}; fixed: {}; fontcolor: {}; fontsize: {}; italics: {}; link: {}; small: {}; strike: {}; sub: {}; sup: {}; }; responseType: {}; readonly responseURL: {}; readonly responseXML: { readonly activeElement: { readonly classList: { readonly length: {}; add: {}; contains: {}; item: {}; remove: {}; toggle: {}; toString: {}; }; className: {}; readonly clientHeight: {}; readonly clientLeft: {}; readonly clientTop: {}; readonly clientWidth: {}; id: {}; innerHTML: {}; msContentZoomFactor: {}; readonly msRegionOverflow: {}; onariarequest: {}; oncommand: {}; ongotpointercapture: {}; onlostpointercapture: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsgotpointercapture: {}; onmsinertiastart: {}; onmslostpointercapture: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; outerHTML: {}; readonly prefix: {}; readonly scrollHeight: {}; scrollLeft: {}; scrollTop: {}; readonly scrollWidth: {}; readonly tagName: {}; readonly assignedSlot: { name: {}; assignedNodes: {}; accessKey: {}; readonly children: { namedItem: {}; readonly length: {}; item: {}; }; contentEditable: {}; readonly dataset: { [x: string]: {}; }; dir: {}; draggable: { valueOf: {}; }; hidden: {}; hideFocus: {}; innerText: {}; readonly isContentEditable: {}; lang: {}; readonly offsetHeight: {}; readonly offsetLeft: {}; readonly offsetParent: {}; readonly offsetTop: {}; readonly offsetWidth: {}; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforecopy: {}; onbeforecut: {}; onbeforedeactivate: {}; onbeforepaste: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; oncopy: {}; oncuechange: {}; oncut: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmouseenter: {}; onmouseleave: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsmanipulationstatechanged: {}; onpaste: {}; onpause: {}; onplay: {}; onplaying: {}; onprogress: {}; onratechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectstart: {}; onstalled: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; onvolumechange: {}; onwaiting: {}; outerText: {}; spellcheck: {}; readonly style: { alignContent: {}; alignItems: {}; alignmentBaseline: {}; alignSelf: {}; animation: {}; animationDelay: {}; animationDirection: {}; animationDuration: {}; animationFillMode: {}; animationIterationCount: {}; animationName: {}; animationPlayState: {}; animationTimingFunction: {}; backfaceVisibility: {}; background: {}; backgroundAttachment: {}; backgroundClip: {}; backgroundColor: {}; backgroundImage: {}; backgroundOrigin: {}; backgroundPosition: {}; backgroundPositionX: {}; backgroundPositionY: {}; backgroundRepeat: {}; backgroundSize: {}; baselineShift: {}; border: {}; borderBottom: {}; borderBottomColor: {}; borderBottomLeftRadius: {}; borderBottomRightRadius: {}; borderBottomStyle: {}; borderBottomWidth: {}; borderCollapse: {}; borderColor: {}; borderImage: {}; borderImageOutset: {}; borderImageRepeat: {}; borderImageSlice: {}; borderImageSource: {}; borderImageWidth: {}; borderLeft: {}; borderLeftColor: {}; borderLeftStyle: {}; borderLeftWidth: {}; borderRadius: {}; borderRight: {}; borderRightColor: {}; borderRightStyle: {}; borderRightWidth: {}; borderSpacing: {}; borderStyle: {}; borderTop: {}; borderTopColor: {}; borderTopLeftRadius: {}; borderTopRightRadius: {}; borderTopStyle: {}; borderTopWidth: {}; borderWidth: {}; bottom: {}; boxShadow: {}; boxSizing: {}; breakAfter: {}; breakBefore: {}; breakInside: {}; captionSide: {}; clear: {}; clip: {}; clipPath: {}; clipRule: {}; color: {}; colorInterpolationFilters: {}; columnCount: {}; columnFill: {}; columnGap: {}; Line truncated
|
||||
>foo : <T>(deep: Deep<T>) => T
|
||||
>xhr : XMLHttpRequest
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
// @lib: es6, dom
|
||||
interface A { a: A }
|
||||
declare let a: A;
|
||||
type Deep<T> = { [K in keyof T]: Deep<T[K]> }
|
||||
declare function foo<T>(deep: Deep<T>): T;
|
||||
const out = foo(a);
|
||||
|
||||
let xhr: XMLHttpRequest;
|
||||
const out2 = foo(xhr);
|
||||
Reference in new issue
Block a user