From d9a0f50d21315526e784f0e424ee1e3ff19e3970 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 1 Jan 2021 12:38:37 -1000 Subject: [PATCH] Accept new baselines --- .../reference/conditionalTypes1.types | 2 +- .../doubleUnderscoreMappedTypes.types | 4 +- .../expressionTypeNodeShouldError.types | 12 ++-- .../reference/genericObjectRest.types | 2 +- .../reference/genericRestParameters1.types | 16 +++--- ...iasAssignableToConstraintSameAsAlias.types | 4 +- .../instantiateContextualTypes.types | 6 +- .../intersectionsOfLargeUnions.types | 6 +- .../intersectionsOfLargeUnions2.types | 6 +- ...omplexSignatureHasApplicabilityError.types | 12 ++-- .../jsxFragmentFactoryNoUnusedLocals.types | 2 +- .../reference/keyofAndIndexedAccess.types | 54 +++++++++--------- .../reference/keyofAndIndexedAccess2.types | 6 +- .../keyofAndIndexedAccessErrors.errors.txt | 24 ++++---- .../keyofAndIndexedAccessErrors.types | 2 +- .../reference/mappedTypeErrors.errors.txt | 56 +++++++++---------- .../reference/mappedTypeErrors.types | 32 +++++------ .../modularizeLibrary_Dom.iterable.types | 4 +- .../normalizedIntersectionTooComplex.types | 8 +-- .../optionalParameterRetainsNull.types | 12 ++-- .../parserOverloadOnConstants1.types | 8 +-- ...artialOfLargeAPIIsAbleToBeWorkedWith.types | 14 ++--- .../reference/privateNamesAndkeyof.types | 2 +- .../reactTagNameComponentWithPropsNoOOM.types | 6 +- ...reactTagNameComponentWithPropsNoOOM2.types | 6 +- .../reference/variadicTuples1.errors.txt | 4 +- 26 files changed, 155 insertions(+), 155 deletions(-) diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index 2ce8803c10f..5d208fa5d18 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -963,7 +963,7 @@ interface B2 extends A { >c : NewDiff } type c1 = B1['c']; // 'c' | 'b' ->c1 : OldDiff<"a" | "b" | "c", "a"> +>c1 : OldDiff type c2 = B2['c']; // 'c' | 'b' >c2 : "b" | "c" diff --git a/tests/baselines/reference/doubleUnderscoreMappedTypes.types b/tests/baselines/reference/doubleUnderscoreMappedTypes.types index c364369e017..68abbf4892e 100644 --- a/tests/baselines/reference/doubleUnderscoreMappedTypes.types +++ b/tests/baselines/reference/doubleUnderscoreMappedTypes.types @@ -24,10 +24,10 @@ const ok: Properties = { // As expected, "__property2" is indeed a key of the type type Keys = keyof Properties; ->Keys : "property1" | "__property2" +>Keys : keyof Properties const k: Keys = "__property2"; // ok ->k : "property1" | "__property2" +>k : keyof Properties >"__property2" : "__property2" // This should be valid diff --git a/tests/baselines/reference/expressionTypeNodeShouldError.types b/tests/baselines/reference/expressionTypeNodeShouldError.types index 8da4edff598..dacaae1f19e 100644 --- a/tests/baselines/reference/expressionTypeNodeShouldError.types +++ b/tests/baselines/reference/expressionTypeNodeShouldError.types @@ -31,9 +31,9 @@ class C { const nodes = document.getElementsByTagName("li"); >nodes : HTMLCollectionOf >document.getElementsByTagName("li") : HTMLCollectionOf ->document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >document : Document ->getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >"li" : "li" type ItemType = "".typeof(nodes.item(0)); @@ -72,9 +72,9 @@ class C2 { const nodes2 = document.getElementsByTagName("li"); >nodes2 : HTMLCollectionOf >document.getElementsByTagName("li") : HTMLCollectionOf ->document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >document : Document ->getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >"li" : "li" type ItemType2 = 4..typeof(nodes.item(0)); @@ -114,9 +114,9 @@ class C3 { const nodes3 = document.getElementsByTagName("li"); >nodes3 : HTMLCollectionOf >document.getElementsByTagName("li") : HTMLCollectionOf ->document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >document : Document ->getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >"li" : "li" type ItemType3 = true.typeof(nodes.item(0)); diff --git a/tests/baselines/reference/genericObjectRest.types b/tests/baselines/reference/genericObjectRest.types index c2fcaad7cb8..57440d3eff1 100644 --- a/tests/baselines/reference/genericObjectRest.types +++ b/tests/baselines/reference/genericObjectRest.types @@ -94,7 +94,7 @@ type Item = { a: string, b: number, c: boolean }; >c : boolean function f4(obj: Item, k1: K1, k2: K2) { ->f4 : (obj: Item, k1: K1, k2: K2) => void +>f4 : (obj: Item, k1: K1, k2: K2) => void >obj : Item >k1 : K1 >k2 : K2 diff --git a/tests/baselines/reference/genericRestParameters1.types b/tests/baselines/reference/genericRestParameters1.types index 89352e1fab2..1e45a3c8662 100644 --- a/tests/baselines/reference/genericRestParameters1.types +++ b/tests/baselines/reference/genericRestParameters1.types @@ -733,35 +733,35 @@ declare var events: EventType; events.emit('move', 10, 'left'); >events.emit('move', 10, 'left') : void ->events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >events : EventType ->emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >'move' : "move" >10 : 10 >'left' : "left" events.emit('jump', 20, 'up'); >events.emit('jump', 20, 'up') : void ->events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >events : EventType ->emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >'jump' : "jump" >20 : 20 >'up' : "up" events.emit('stop', 'Bye!'); >events.emit('stop', 'Bye!') : void ->events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >events : EventType ->emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >'stop' : "stop" >'Bye!' : "Bye!" events.emit('done'); >events.emit('done') : void ->events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>events.emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >events : EventType ->emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void +>emit : (e: K, ...payload: Record1[K] extends any[] ? Record1[K] : [Record1[K]]) => void >'done' : "done" // Repro from #25871 diff --git a/tests/baselines/reference/inlinedAliasAssignableToConstraintSameAsAlias.types b/tests/baselines/reference/inlinedAliasAssignableToConstraintSameAsAlias.types index d337fbc718a..0963420af3a 100644 --- a/tests/baselines/reference/inlinedAliasAssignableToConstraintSameAsAlias.types +++ b/tests/baselines/reference/inlinedAliasAssignableToConstraintSameAsAlias.types @@ -10,7 +10,7 @@ interface RelationFields { >z : A[] } type Name = keyof RelationFields; ->Name : "x" | "y" | "z" +>Name : keyof RelationFields type ShouldA = RF[N] extends A[] >ShouldA : ShouldA @@ -31,7 +31,7 @@ class A { >z : A[] whereRelated< // Works // Type is same as A1, but is not assignable to type A ->whereRelated : >() => number +>whereRelated : >() => number RF extends RelationFields = RelationFields, N extends Name = Name, diff --git a/tests/baselines/reference/instantiateContextualTypes.types b/tests/baselines/reference/instantiateContextualTypes.types index c50a74418f2..ff6154c7858 100644 --- a/tests/baselines/reference/instantiateContextualTypes.types +++ b/tests/baselines/reference/instantiateContextualTypes.types @@ -185,7 +185,7 @@ type O = { >O : O on

(x: P, callback: R[P]): void; ->on :

(x: P, callback: R[P]) => void +>on :

(x: P, callback: R[P]) => void >x : P >callback : R[P] @@ -196,9 +196,9 @@ declare var x: O; x.on('a', a => {}); >x.on('a', a => {}) : void ->x.on :

(x: P, callback: R[P]) => void +>x.on :

(x: P, callback: R[P]) => void >x : O ->on :

(x: P, callback: R[P]) => void +>on :

(x: P, callback: R[P]) => void >'a' : "a" >a => {} : (a: number) => void >a : number diff --git a/tests/baselines/reference/intersectionsOfLargeUnions.types b/tests/baselines/reference/intersectionsOfLargeUnions.types index d42586516ea..98c98f03f17 100644 --- a/tests/baselines/reference/intersectionsOfLargeUnions.types +++ b/tests/baselines/reference/intersectionsOfLargeUnions.types @@ -24,7 +24,7 @@ export function assertIsElement(node: Node | null): node is Element { } export function assertNodeTagName< ->assertNodeTagName : (node: Node | null, tagName: T) => node is U +>assertNodeTagName : (node: Node | null, tagName: T) => node is U T extends keyof ElementTagNameMap, U extends ElementTagNameMap[T]>(node: Node | null, tagName: T): node is U { @@ -56,7 +56,7 @@ export function assertNodeTagName< } export function assertNodeProperty< ->assertNodeProperty : (node: Node | null, tagName: T, prop: P, value: V) => void +>assertNodeProperty : (node: Node | null, tagName: T, prop: P, value: V) => void T extends keyof ElementTagNameMap, P extends keyof ElementTagNameMap[T], @@ -69,7 +69,7 @@ export function assertNodeProperty< if (assertNodeTagName(node, tagName)) { >assertNodeTagName(node, tagName) : boolean ->assertNodeTagName : (node: Node | null, tagName: T) => node is U +>assertNodeTagName : (node: Node | null, tagName: T) => node is U >node : Node | null >tagName : T diff --git a/tests/baselines/reference/intersectionsOfLargeUnions2.types b/tests/baselines/reference/intersectionsOfLargeUnions2.types index 312be060cbe..20423283010 100644 --- a/tests/baselines/reference/intersectionsOfLargeUnions2.types +++ b/tests/baselines/reference/intersectionsOfLargeUnions2.types @@ -38,7 +38,7 @@ export function assertIsElement(node: Node | null): node is Element { } export function assertNodeTagName< ->assertNodeTagName : (node: Node | null, tagName: T) => node is U +>assertNodeTagName : (node: Node | null, tagName: T) => node is U T extends keyof ElementTagNameMap, U extends ElementTagNameMap[T]>(node: Node | null, tagName: T): node is U { @@ -70,7 +70,7 @@ export function assertNodeTagName< } export function assertNodeProperty< ->assertNodeProperty : (node: Node | null, tagName: T, prop: P, value: V) => void +>assertNodeProperty : (node: Node | null, tagName: T, prop: P, value: V) => void T extends keyof ElementTagNameMap, P extends keyof ElementTagNameMap[T], @@ -83,7 +83,7 @@ export function assertNodeProperty< if (assertNodeTagName(node, tagName)) { >assertNodeTagName(node, tagName) : boolean ->assertNodeTagName : (node: Node | null, tagName: T) => node is U +>assertNodeTagName : (node: Node | null, tagName: T) => node is U >node : Node | null >tagName : T diff --git a/tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types b/tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types index 8bdf3e397db..a469dc672ce 100644 --- a/tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types +++ b/tests/baselines/reference/jsxComplexSignatureHasApplicabilityError.types @@ -39,8 +39,8 @@ export function createReactSingleSelect< >React : any return (props) => { ->(props) => { return ( > {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ); } : (props: Omit, keyof Omit & ("value" | "onChange")> & Props> & { children?: React.ReactNode; }) => JSX.Element ->props : Omit, keyof Omit & ("value" | "onChange")> & Props> & { children?: React.ReactNode; } +>(props) => { return ( > {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ); } : (props: Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; }) => JSX.Element +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } return ( >( > {...props} multi={false} autosize={false} value={props.value} onChange={(value) => { if (props.onChange) { props.onChange(value === null ? undefined : value); } }} /> ) : JSX.Element @@ -50,7 +50,7 @@ export function createReactSingleSelect< >ReactSelectClass : typeof ReactSelectClass {...props} ->props : Omit, keyof Omit & ("value" | "onChange")> & Props> & { children?: React.ReactNode; } +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } multi={false} >multi : false @@ -63,7 +63,7 @@ export function createReactSingleSelect< value={props.value} >value : ExtractValueType | Option> | undefined >props.value : ExtractValueType | Option> | undefined ->props : Omit, keyof Omit & ("value" | "onChange")> & Props> & { children?: React.ReactNode; } +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } >value : ExtractValueType | Option> | undefined onChange={(value) => { @@ -73,13 +73,13 @@ export function createReactSingleSelect< if (props.onChange) { >props.onChange : ((value: Option> | undefined) => void) | undefined ->props : Omit, keyof Omit & ("value" | "onChange")> & Props> & { children?: React.ReactNode; } +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } >onChange : ((value: Option> | undefined) => void) | undefined props.onChange(value === null ? undefined : value); >props.onChange(value === null ? undefined : value) : void >props.onChange : (value: Option> | undefined) => void ->props : Omit, keyof Omit & ("value" | "onChange")> & Props> & { children?: React.ReactNode; } +>props : Omit, keyof Omit & keyof Props>> & Props> & { children?: React.ReactNode; } >onChange : (value: Option> | undefined) => void >value === null ? undefined : value : Option> | Options> | undefined >value === null : boolean diff --git a/tests/baselines/reference/jsxFragmentFactoryNoUnusedLocals.types b/tests/baselines/reference/jsxFragmentFactoryNoUnusedLocals.types index 75a9122b486..a83aca50051 100644 --- a/tests/baselines/reference/jsxFragmentFactoryNoUnusedLocals.types +++ b/tests/baselines/reference/jsxFragmentFactoryNoUnusedLocals.types @@ -2,7 +2,7 @@ /// import { Fragment, createElement } from "react" >Fragment : import("react").ComponentType<{}> ->createElement : { (type: "input", props?: import("react").InputHTMLAttributes & import("react").ClassAttributes, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement, HTMLInputElement>;

, T extends HTMLElement>(type: "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview", props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement;

, T extends SVGElement>(type: "symbol" | "text" | "animate" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "textPath" | "tspan" | "use" | "view", props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").ReactSVGElement;

, T extends Element>(type: string, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").DOMElement;

(type: import("react").SFC

, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").SFCElement

;

(type: import("react").ClassType, import("react").ClassicComponentClass

>, props?: import("react").ClassAttributes> & P, ...children: import("react").ReactNode[]): import("react").CElement>; , C extends import("react").ComponentClass>(type: import("react").ClassType, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").CElement;

(type: string | import("react").SFC

| import("react").ComponentClass, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").ReactElement

; } +>createElement : { (type: "input", props?: import("react").InputHTMLAttributes & import("react").ClassAttributes, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement, HTMLInputElement>;

, T extends HTMLElement>(type: keyof import("react").ReactHTML, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").DetailedReactHTMLElement;

, T extends SVGElement>(type: keyof import("react").ReactSVG, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").ReactSVGElement;

, T extends Element>(type: string, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").DOMElement;

(type: import("react").SFC

, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").SFCElement

;

(type: import("react").ClassType, import("react").ClassicComponentClass

>, props?: import("react").ClassAttributes> & P, ...children: import("react").ReactNode[]): import("react").CElement>; , C extends import("react").ComponentClass>(type: import("react").ClassType, props?: import("react").ClassAttributes & P, ...children: import("react").ReactNode[]): import("react").CElement;

(type: string | import("react").SFC

| import("react").ComponentClass, props?: import("react").Attributes & P, ...children: import("react").ReactNode[]): import("react").ReactElement

; } type CounterProps = { >CounterProps : CounterProps diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 19b703523b4..f2dda4a8897 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -83,10 +83,10 @@ type K08 = keyof unknown; // never >K08 : never type K10 = keyof Shape; // "name" | "width" | "height" | "visible" ->K10 : "name" | "width" | "height" | "visible" +>K10 : keyof Shape type K11 = keyof Shape[]; // "length" | "toString" | ... ->K11 : number | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" +>K11 : number | keyof Shape[] type K12 = keyof Dictionary; // string >K12 : string | number @@ -95,13 +95,13 @@ type K13 = keyof {}; // never >K13 : never type K14 = keyof Object; // "constructor" | "toString" | ... ->K14 : "toString" | "toLocaleString" | "valueOf" | "constructor" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" +>K14 : keyof Object type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ... >K15 : "toString" | "toLocaleString" | "valueOf" | "toFixed" | "toExponential" | "toPrecision" type K16 = keyof [string, number]; // "0" | "1" | "length" | "toString" | ... ->K16 : number | "0" | "1" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" +>K16 : number | keyof [string, number] type K17 = keyof (Shape | Item); // "name" >K17 : "name" @@ -116,7 +116,7 @@ type KeyOf = keyof T; >KeyOf : keyof T type K20 = KeyOf; // "name" | "width" | "height" | "visible" ->K20 : "name" | "width" | "height" | "visible" +>K20 : keyof Shape type K21 = KeyOf>; // string >K21 : string | number @@ -380,17 +380,17 @@ function f20(component: Component) { let name = component.getProperty("name"); // string >name : string >component.getProperty("name") : string ->component.getProperty : (key: K) => Shape[K] +>component.getProperty : (key: K) => Shape[K] >component : Component ->getProperty : (key: K) => Shape[K] +>getProperty : (key: K) => Shape[K] >"name" : "name" let widthOrHeight = component.getProperty(cond ? "width" : "height"); // number >widthOrHeight : number >component.getProperty(cond ? "width" : "height") : number ->component.getProperty : (key: K) => Shape[K] +>component.getProperty : (key: K) => Shape[K] >component : Component ->getProperty : (key: K) => Shape[K] +>getProperty : (key: K) => Shape[K] >cond ? "width" : "height" : "width" | "height" >cond : boolean >"width" : "width" @@ -399,9 +399,9 @@ function f20(component: Component) { let nameOrVisible = component.getProperty(cond ? "name" : "visible"); // string | boolean >nameOrVisible : string | boolean >component.getProperty(cond ? "name" : "visible") : string | boolean ->component.getProperty : (key: K) => Shape[K] +>component.getProperty : (key: K) => Shape[K] >component : Component ->getProperty : (key: K) => Shape[K] +>getProperty : (key: K) => Shape[K] >cond ? "name" : "visible" : "name" | "visible" >cond : boolean >"name" : "name" @@ -409,17 +409,17 @@ function f20(component: Component) { component.setProperty("name", "rectangle"); >component.setProperty("name", "rectangle") : void ->component.setProperty : (key: K, value: Shape[K]) => void +>component.setProperty : (key: K, value: Shape[K]) => void >component : Component ->setProperty : (key: K, value: Shape[K]) => void +>setProperty : (key: K, value: Shape[K]) => void >"name" : "name" >"rectangle" : "rectangle" component.setProperty(cond ? "width" : "height", 10) >component.setProperty(cond ? "width" : "height", 10) : void ->component.setProperty : (key: K, value: Shape[K]) => void +>component.setProperty : (key: K, value: Shape[K]) => void >component : Component ->setProperty : (key: K, value: Shape[K]) => void +>setProperty : (key: K, value: Shape[K]) => void >cond ? "width" : "height" : "width" | "height" >cond : boolean >"width" : "width" @@ -428,9 +428,9 @@ function f20(component: Component) { component.setProperty(cond ? "name" : "visible", true); // Technically not safe >component.setProperty(cond ? "name" : "visible", true) : void ->component.setProperty : (key: K, value: Shape[K]) => void +>component.setProperty : (key: K, value: Shape[K]) => void >component : Component ->setProperty : (key: K, value: Shape[K]) => void +>setProperty : (key: K, value: Shape[K]) => void >cond ? "name" : "visible" : "name" | "visible" >cond : boolean >"name" : "name" @@ -485,7 +485,7 @@ function f30(shapes: Shape[]) { } function f31(key: K) { ->f31 : (key: K) => Shape[K] +>f31 : (key: K) => Shape[K] >key : K const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; @@ -1207,15 +1207,15 @@ type S2 = { }; function f90(x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) { ->f90 : (x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) => void +>f90 : (x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) => void >x1 : string ->x2 : T["a" | "b"] +>x2 : T[keyof S2] >x3 : S2[K] x1 = x2; ->x1 = x2 : T["a" | "b"] +>x1 = x2 : T[keyof S2] >x1 : string ->x2 : T["a" | "b"] +>x2 : T[keyof S2] x1 = x3; >x1 = x3 : S2[K] @@ -1224,12 +1224,12 @@ function f90(x1: S2[keyof S2], x2: T[keyof S2] x2 = x1; >x2 = x1 : string ->x2 : T["a" | "b"] +>x2 : T[keyof S2] >x1 : string x2 = x3; >x2 = x3 : S2[K] ->x2 : T["a" | "b"] +>x2 : T[keyof S2] >x3 : S2[K] x3 = x1; @@ -1238,9 +1238,9 @@ function f90(x1: S2[keyof S2], x2: T[keyof S2] >x1 : string x3 = x2; ->x3 = x2 : T["a" | "b"] +>x3 = x2 : T[keyof S2] >x3 : S2[K] ->x2 : T["a" | "b"] +>x2 : T[keyof S2] x1.length; >x1.length : number @@ -1249,7 +1249,7 @@ function f90(x1: S2[keyof S2], x2: T[keyof S2] x2.length; >x2.length : number ->x2 : T["a" | "b"] +>x2 : T[keyof S2] >length : number x3.length; diff --git a/tests/baselines/reference/keyofAndIndexedAccess2.types b/tests/baselines/reference/keyofAndIndexedAccess2.types index bde0ec562cb..b4e2743b51a 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess2.types +++ b/tests/baselines/reference/keyofAndIndexedAccess2.types @@ -236,7 +236,7 @@ function f10(obj: T, k1: string, k2: keyof It >f10 : (obj: T, k1: string, k2: keyof Item, k3: keyof T, k4: K) => void >obj : T >k1 : string ->k2 : "a" | "b" +>k2 : keyof Item >k3 : keyof T >k4 : K @@ -251,7 +251,7 @@ function f10(obj: T, k1: string, k2: keyof It >obj[k2] = 123 : 123 >obj[k2] : never >obj : T ->k2 : "a" | "b" +>k2 : keyof Item >123 : 123 obj[k3] = 123; // Error @@ -417,7 +417,7 @@ interface Type { } function get123(): Type[K] { ->get123 : () => Type[K] +>get123 : () => Type[K] return 123; // Error >123 : 123 diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt index 6bc2e322e17..3b2c36f1f89 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt @@ -17,12 +17,12 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(35,21): error tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(36,21): error TS2538: Type 'boolean' cannot be used as an index type. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(41,31): error TS2538: Type 'boolean' cannot be used as an index type. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(46,16): error TS2538: Type 'boolean' cannot be used as an index type. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(63,33): error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(64,33): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. - Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(66,24): error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(67,24): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. - Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(63,33): error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(64,33): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'. + Type '"size"' is not assignable to type 'keyof Shape'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(66,24): error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(67,24): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'. + Type '"size"' is not assignable to type 'keyof Shape'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(73,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(74,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(82,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof T & keyof U'. @@ -179,19 +179,19 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error let x1 = getProperty(shape, "name"); let x2 = getProperty(shape, "size"); // Error ~~~~~~ -!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. +!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'. let x3 = getProperty(shape, cond ? "name" : "size"); // Error ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. -!!! error TS2345: Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'. +!!! error TS2345: Type '"size"' is not assignable to type 'keyof Shape'. setProperty(shape, "name", "rectangle"); setProperty(shape, "size", 10); // Error ~~~~~~ -!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. +!!! error TS2345: Argument of type '"size"' is not assignable to parameter of type 'keyof Shape'. setProperty(shape, cond ? "name" : "size", 10); // Error ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. -!!! error TS2345: Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type 'keyof Shape'. +!!! error TS2345: Type '"size"' is not assignable to type 'keyof Shape'. } function f20(x: T | U, y: T & U, k1: keyof (T | U), k2: keyof T & keyof U, k3: keyof (T & U), k4: keyof T | keyof U) { diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index 80ffabefaf2..27f0642094e 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -23,7 +23,7 @@ type T00 = keyof K0; // Error >T00 : string | number | symbol type T01 = keyof Object; ->T01 : "toString" | "valueOf" | "toLocaleString" | "constructor" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" +>T01 : keyof Object type T02 = keyof keyof Object; >T02 : number | "length" | "toString" | "valueOf" | "charAt" | "charCodeAt" | "concat" | "indexOf" | "lastIndexOf" | "localeCompare" | "match" | "replace" | "search" | "slice" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 0dc68732e81..b2c59fce02c 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -3,17 +3,17 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(21,20): error TS2322: T Type 'Date' is not assignable to type 'number'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(22,19): error TS2344: Type 'Date' does not satisfy the constraint 'string | number | symbol'. Type 'Date' is not assignable to type 'number'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. - Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(28,24): error TS2344: Type '"x" | "y"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. - Type '"x"' is not assignable to type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(30,24): error TS2344: Type 'undefined' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(33,24): error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint 'keyof Shape'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint 'keyof Shape'. + Type '"foo"' is not assignable to type 'keyof Shape'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(28,24): error TS2344: Type 'keyof Point' does not satisfy the constraint 'keyof Shape'. + Type '"x"' is not assignable to type 'keyof Shape'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(30,24): error TS2344: Type 'undefined' does not satisfy the constraint 'keyof Shape'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(33,24): error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'. Type 'T' is not assignable to type '"visible"'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. - Type 'string | number' is not assignable to type '"name" | "width" | "height" | "visible"'. - Type 'string' is not assignable to type '"name" | "width" | "height" | "visible"'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'. + Type 'string | number' is not assignable to type 'keyof Shape'. + Type 'string' is not assignable to type 'keyof Shape'. Type 'T' is not assignable to type '"visible"'. Type 'string | number' is not assignable to type '"visible"'. Type 'string' is not assignable to type '"visible"'. @@ -28,11 +28,11 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(77,59): error TS2345: A tests/cases/conformance/types/mapped/mappedTypeErrors.ts(83,58): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'. Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(105,17): error TS2322: Type 'undefined' is not assignable to type 'string'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(106,17): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. - Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(106,17): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. + Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(123,14): error TS2322: Type 'undefined' is not assignable to type 'string'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. - Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(124,14): error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. + Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'. @@ -78,34 +78,34 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: type T10 = Pick; type T11 = Pick; // Error ~~~~~ -!!! error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type '"foo"' does not satisfy the constraint 'keyof Shape'. type T12 = Pick; // Error ~~~~~~~~~~~~~~ -!!! error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -!!! error TS2344: Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type '"name" | "foo"' does not satisfy the constraint 'keyof Shape'. +!!! error TS2344: Type '"foo"' is not assignable to type 'keyof Shape'. type T13 = Pick; type T14 = Pick; // Error ~~~~~~~~~~~ -!!! error TS2344: Type '"x" | "y"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -!!! error TS2344: Type '"x"' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type 'keyof Point' does not satisfy the constraint 'keyof Shape'. +!!! error TS2344: Type '"x"' is not assignable to type 'keyof Shape'. type T15 = Pick; type T16 = Pick; // Error ~~~~~~~~~ -!!! error TS2344: Type 'undefined' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type 'undefined' does not satisfy the constraint 'keyof Shape'. function f1(x: T) { let y: Pick; // Error ~ -!!! error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'. !!! error TS2344: Type 'T' is not assignable to type '"visible"'. } function f2(x: T) { let y: Pick; // Error ~ -!!! error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. -!!! error TS2344: Type 'string | number' is not assignable to type '"name" | "width" | "height" | "visible"'. -!!! error TS2344: Type 'string' is not assignable to type '"name" | "width" | "height" | "visible"'. +!!! error TS2344: Type 'T' does not satisfy the constraint 'keyof Shape'. +!!! error TS2344: Type 'string | number' is not assignable to type 'keyof Shape'. +!!! error TS2344: Type 'string' is not assignable to type 'keyof Shape'. !!! error TS2344: Type 'T' is not assignable to type '"visible"'. !!! error TS2344: Type 'string | number' is not assignable to type '"visible"'. !!! error TS2344: Type 'string' is not assignable to type '"visible"'. @@ -204,8 +204,8 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: !!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:89:5: The expected type comes from property 'a' which is declared here on type 'Pick' setState(foo, { c: true }); // Error ~~~~~~~ -!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. -!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. +!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. class C { state: T; @@ -228,8 +228,8 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: !!! related TS6500 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:89:5: The expected type comes from property 'a' which is declared here on type 'Pick' c.setState({ c: true }); // Error ~~~~~~~ -!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. -!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. +!!! error TS2345: Argument of type '{ c: boolean; }' is not assignable to parameter of type 'Pick'. +!!! error TS2345: Object literal may only specify known properties, and 'c' does not exist in type 'Pick'. type T2 = { a?: number, [key: string]: any }; diff --git a/tests/baselines/reference/mappedTypeErrors.types b/tests/baselines/reference/mappedTypeErrors.types index f8468ca0aad..7a5c1c28dd1 100644 --- a/tests/baselines/reference/mappedTypeErrors.types +++ b/tests/baselines/reference/mappedTypeErrors.types @@ -53,7 +53,7 @@ type T13 = Pick; >T13 : Pick type T14 = Pick; // Error ->T14 : Pick +>T14 : Pick type T15 = Pick; >T15 : Pick @@ -78,7 +78,7 @@ function f2(x: T) { } function f3(x: T) { ->f3 : (x: T) => void +>f3 : (x: T) => void >x : T let y: Pick; @@ -374,9 +374,9 @@ let c = new C(); c.setState({ a: "test", b: 43 }); >c.setState({ a: "test", b: 43 }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ a: "test", b: 43 } : { a: string; b: number; } >a : string >"test" : "test" @@ -385,50 +385,50 @@ c.setState({ a: "test", b: 43 }); c.setState({ a: "hi" }); >c.setState({ a: "hi" }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ a: "hi" } : { a: string; } >a : string >"hi" : "hi" c.setState({ b: undefined }); >c.setState({ b: undefined }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ b: undefined } : { b: undefined; } >b : undefined >undefined : undefined c.setState({ }); >c.setState({ }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ } : {} c.setState(foo); >c.setState(foo) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >foo : Foo c.setState({ a: undefined }); // Error >c.setState({ a: undefined }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ a: undefined } : { a: undefined; } >a : undefined >undefined : undefined c.setState({ c: true }); // Error >c.setState({ c: true }) : void ->c.setState : (props: Pick) => void +>c.setState : (props: Pick) => void >c : C ->setState : (props: Pick) => void +>setState : (props: Pick) => void >{ c: true } : { c: boolean; } >c : boolean >true : true diff --git a/tests/baselines/reference/modularizeLibrary_Dom.iterable.types b/tests/baselines/reference/modularizeLibrary_Dom.iterable.types index 154c3978108..6aacbf961db 100644 --- a/tests/baselines/reference/modularizeLibrary_Dom.iterable.types +++ b/tests/baselines/reference/modularizeLibrary_Dom.iterable.types @@ -2,9 +2,9 @@ for (const element of document.getElementsByTagName("a")) { >element : HTMLAnchorElement >document.getElementsByTagName("a") : HTMLCollectionOf ->document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>document.getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >document : Document ->getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } +>getElementsByTagName : { (qualifiedName: K): HTMLCollectionOf; (qualifiedName: K): HTMLCollectionOf; (qualifiedName: string): HTMLCollectionOf; } >"a" : "a" element.href; diff --git a/tests/baselines/reference/normalizedIntersectionTooComplex.types b/tests/baselines/reference/normalizedIntersectionTooComplex.types index a5069b6af28..e7a49a50583 100644 --- a/tests/baselines/reference/normalizedIntersectionTooComplex.types +++ b/tests/baselines/reference/normalizedIntersectionTooComplex.types @@ -128,17 +128,17 @@ interface Big { >ref : Obj<{ common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; }> | Func<{ common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; }> | undefined } declare function getCtor(comp: T): CtorOf ->getCtor : (comp: T) => CtorOf +>getCtor : (comp: T) => CtorOf >comp : T declare var all: keyof Big; ->all : "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" +>all : keyof Big const ctor = getCtor(all); >ctor : CtorOf<{ common?: string | undefined; "0"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; }> >getCtor(all) : CtorOf<{ common?: string | undefined; "0"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; }> ->getCtor : (comp: T) => CtorOf ->all : "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14" | "15" | "16" | "17" +>getCtor : (comp: T) => CtorOf +>all : keyof Big const comp = ctor({ common: "ok", ref: x => console.log(x) }); >comp : { common?: string | undefined; "0"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "1"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "2"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "3"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "4"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "5"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "6"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "7"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "8"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "9"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "10"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "11"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "12"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "13"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "14"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "15"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "16"?: number | undefined; ref?: Obj | Func | undefined; } | { common?: string | undefined; "17"?: number | undefined; ref?: Obj | Func | undefined; } diff --git a/tests/baselines/reference/optionalParameterRetainsNull.types b/tests/baselines/reference/optionalParameterRetainsNull.types index b2ca132d42b..94bf71a6f3d 100644 --- a/tests/baselines/reference/optionalParameterRetainsNull.types +++ b/tests/baselines/reference/optionalParameterRetainsNull.types @@ -5,11 +5,11 @@ interface Bar { bar: number; foo: object | null; } >null : null let a = { ->a : { test(a: K, b?: Bar[K] | null | undefined): void; } ->{ test (a: K, b?: Bar[K] | null) { }} : { test(a: K, b?: Bar[K] | null | undefined): void; } +>a : { test(a: K, b?: Bar[K] | null | undefined): void; } +>{ test (a: K, b?: Bar[K] | null) { }} : { test(a: K, b?: Bar[K] | null | undefined): void; } test (a: K, b?: Bar[K] | null) { } ->test : (a: K, b?: Bar[K] | null | undefined) => void +>test : (a: K, b?: Bar[K] | null | undefined) => void >a : K >b : Bar[K] | null | undefined >null : null @@ -17,9 +17,9 @@ let a = { }; a.test("bar", null); // ok, null is assignable to number | null | undefined >a.test("bar", null) : void ->a.test : (a: K, b?: Bar[K] | null | undefined) => void ->a : { test(a: K, b?: Bar[K] | null | undefined): void; } ->test : (a: K, b?: Bar[K] | null | undefined) => void +>a.test : (a: K, b?: Bar[K] | null | undefined) => void +>a : { test(a: K, b?: Bar[K] | null | undefined): void; } +>test : (a: K, b?: Bar[K] | null | undefined) => void >"bar" : "bar" >null : null diff --git a/tests/baselines/reference/parserOverloadOnConstants1.types b/tests/baselines/reference/parserOverloadOnConstants1.types index 6a786c50eb5..15625372f26 100644 --- a/tests/baselines/reference/parserOverloadOnConstants1.types +++ b/tests/baselines/reference/parserOverloadOnConstants1.types @@ -1,18 +1,18 @@ === tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts === interface Document { createElement(tagName: string): HTMLElement; ->createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } +>createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : string createElement(tagName: 'canvas'): HTMLCanvasElement; ->createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: 'canvas'): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } +>createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: 'canvas'): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : "canvas" createElement(tagName: 'div'): HTMLDivElement; ->createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: 'div'): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } +>createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: 'div'): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : "div" createElement(tagName: 'span'): HTMLSpanElement; ->createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: 'span'): HTMLSpanElement; } +>createElement : { (tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; (tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; (tagName: string, options?: ElementCreationOptions): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: 'span'): HTMLSpanElement; } >tagName : "span" } diff --git a/tests/baselines/reference/partialOfLargeAPIIsAbleToBeWorkedWith.types b/tests/baselines/reference/partialOfLargeAPIIsAbleToBeWorkedWith.types index f3b7406a3dd..fbd46f7fdce 100644 --- a/tests/baselines/reference/partialOfLargeAPIIsAbleToBeWorkedWith.types +++ b/tests/baselines/reference/partialOfLargeAPIIsAbleToBeWorkedWith.types @@ -214,17 +214,17 @@ const obj: Partial = {}; >{} : {} declare var keys: (keyof MyAPI)[]; ->keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[] +>keys : (keyof MyAPI)[] for (const k of keys) { ->k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 ->keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[] +>k : keyof MyAPI +>keys : (keyof MyAPI)[] obj[k] = () => "12"; // shouldn't cause a complexity error >obj[k] = () => "12" : () => string >obj[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | undefined >obj : Partial ->k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 +>k : keyof MyAPI >() => "12" : () => string >"12" : "12" } @@ -238,14 +238,14 @@ const obj2: PartialNull = {}; >{} : {} for (const k of keys) { ->k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 ->keys : (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51)[] +>k : keyof MyAPI +>keys : (keyof MyAPI)[] obj2[k] = () => "12"; // shouldn't cause a complexity error >obj2[k] = () => "12" : () => string >obj2[k] : (((x: 0) => string) & ((x: 1) => string) & ((x: 2) => string) & ((x: 3) => string) & ((x: 4) => string) & ((x: 5) => string) & ((x: 6) => string) & ((x: 7) => string) & ((x: 8) => string) & ((x: 9) => string) & ((x: 10) => string) & ((x: 11) => string) & ((x: 12) => string) & ((x: 13) => string) & ((x: 14) => string) & ((x: 15) => string) & ((x: 16) => string) & ((x: 17) => string) & ((x: 18) => string) & ((x: 19) => string) & ((x: 20) => string) & ((x: 21) => string) & ((x: 22) => string) & ((x: 23) => string) & ((x: 24) => string) & ((x: 25) => string) & ((x: 26) => string) & ((x: 27) => string) & ((x: 28) => string) & ((x: 29) => string) & ((x: 30) => string) & ((x: 31) => string) & ((x: 32) => string) & ((x: 33) => string) & ((x: 34) => string) & ((x: 35) => string) & ((x: 36) => string) & ((x: 37) => string) & ((x: 38) => string) & ((x: 39) => string) & ((x: 40) => string) & ((x: 41) => string) & ((x: 42) => string) & ((x: 43) => string) & ((x: 44) => string) & ((x: 45) => string) & ((x: 46) => string) & ((x: 47) => string) & ((x: 48) => string) & ((x: 49) => string) & ((x: 50) => string) & ((x: 51) => string)) | null | undefined >obj2 : PartialNull ->k : 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 +>k : keyof MyAPI >() => "12" : () => string >"12" : "12" } diff --git a/tests/baselines/reference/privateNamesAndkeyof.types b/tests/baselines/reference/privateNamesAndkeyof.types index 23625ad025c..3c063097dd4 100644 --- a/tests/baselines/reference/privateNamesAndkeyof.types +++ b/tests/baselines/reference/privateNamesAndkeyof.types @@ -16,5 +16,5 @@ class A { } type T = keyof A // should not include '#foo' ->T : "bar" | "baz" +>T : keyof A diff --git a/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM.types b/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM.types index f31716a55e4..badbee67f73 100644 --- a/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM.types +++ b/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM.types @@ -5,7 +5,7 @@ import * as React from "react"; >React : typeof React declare const Tag: keyof React.ReactHTML; ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML >React : any const classes = ""; @@ -22,7 +22,7 @@ const children: any[] = []; >{children} : JSX.Element ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML >className : string >classes : "" >rest : {} @@ -31,5 +31,5 @@ const children: any[] = []; >children : any[] ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML diff --git a/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM2.types b/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM2.types index fac8a844e03..5d82838481b 100644 --- a/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM2.types +++ b/tests/baselines/reference/reactTagNameComponentWithPropsNoOOM2.types @@ -5,7 +5,7 @@ import * as React from "react"; >React : typeof React declare const Tag: keyof React.ReactHTML; ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML >React : any const classes = ""; @@ -23,7 +23,7 @@ const children: any[] = []; >{children} : JSX.Element ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML >className : string >classes : "" >rest : React.HTMLAttributes @@ -32,5 +32,5 @@ const children: any[] = []; >children : any[] ->Tag : "object" | "time" | "link" | "menu" | "dialog" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" +>Tag : keyof React.ReactHTML diff --git a/tests/baselines/reference/variadicTuples1.errors.txt b/tests/baselines/reference/variadicTuples1.errors.txt index 416565221bb..7794a14aa0c 100644 --- a/tests/baselines/reference/variadicTuples1.errors.txt +++ b/tests/baselines/reference/variadicTuples1.errors.txt @@ -38,7 +38,7 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(191,5): error TS2322: Typ Type 'readonly string[]' is not assignable to type 'U'. 'U' could be instantiated with an arbitrary type which could be unrelated to 'readonly string[]'. tests/cases/conformance/types/tuple/variadicTuples1.ts(203,5): error TS2322: Type 'string' is not assignable to type 'keyof [1, 2, ...T]'. - Type '"2"' is not assignable to type 'number | "0" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" | "1"'. + Type '"2"' is not assignable to type '"0" | (number | keyof T[]) | "1"'. tests/cases/conformance/types/tuple/variadicTuples1.ts(346,14): error TS7019: Rest parameter 'x' implicitly has an 'any[]' type. tests/cases/conformance/types/tuple/variadicTuples1.ts(354,26): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/tuple/variadicTuples1.ts(393,19): error TS1256: A rest element must be last in a tuple type. @@ -309,7 +309,7 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(397,12): error TS1256: A k3 = '2'; // Error ~~ !!! error TS2322: Type 'string' is not assignable to type 'keyof [1, 2, ...T]'. -!!! error TS2322: Type '"2"' is not assignable to type 'number | "0" | "length" | "toString" | "toLocaleString" | "pop" | "push" | "concat" | "join" | "reverse" | "shift" | "slice" | "sort" | "splice" | "unshift" | "indexOf" | "lastIndexOf" | "every" | "some" | "forEach" | "map" | "filter" | "reduce" | "reduceRight" | "1"'. +!!! error TS2322: Type '"2"' is not assignable to type '"0" | (number | keyof T[]) | "1"'. } // Inference between variadic tuple types