Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8f2e00f
Create separate types for equivalent aliased unions
ahejlsberg Dec 25, 2020
1e9ea77
Accept new baselines
ahejlsberg Dec 25, 2020
c9bea0c
Preserve original types for union types
ahejlsberg Dec 28, 2020
2e2048c
Accept new baselines
ahejlsberg Dec 28, 2020
44231c8
Preserve intersection origin for union types
ahejlsberg Dec 29, 2020
829285f
Accept new baselines
ahejlsberg Dec 29, 2020
536e41e
Accept new baselines
ahejlsberg Dec 29, 2020
cc5d0f2
Preserve aliases during relationship checks
ahejlsberg Dec 29, 2020
b2434fc
Accept new baselines
ahejlsberg Dec 29, 2020
6c1248e
Preserve aliases for intersection and indexed access types
ahejlsberg Dec 29, 2020
237e9ca
Accept new baselines
ahejlsberg Dec 29, 2020
d4dc215
Compute intersection-of-unions cross product without recursion
ahejlsberg Dec 30, 2020
11d2712
Accept new baselines
ahejlsberg Dec 30, 2020
39f82a8
Use denormalized type objects for origin / support 'keyof' origins
ahejlsberg Jan 1, 2021
d9a0f50
Accept new baselines
ahejlsberg Jan 1, 2021
e0d4774
Fix fourslash test
ahejlsberg Jan 1, 2021
21f61c0
Recursively extract named union types
ahejlsberg Jan 2, 2021
785d2b7
Accept new baselines
ahejlsberg Jan 2, 2021
d98caab
Map on union origin in mapType to better preserve aliases and origins
ahejlsberg Jan 3, 2021
260a665
Remove redundant call
ahejlsberg Jan 4, 2021
8597325
Accept new baselines
ahejlsberg Jan 4, 2021
5f7e126
Revert back to declared type when branches produce equivalent union
ahejlsberg Jan 4, 2021
8ef90e7
Accept new baselines
ahejlsberg Jan 4, 2021
4c9675c
Merge branch 'master' into preserveTypeAliases
ahejlsberg Jan 4, 2021
3fce1b9
Don't include denormal origin types in regular type statistics
ahejlsberg Jan 4, 2021
99355c5
Merge branch 'master' into preserveTypeAliases
ahejlsberg Jan 5, 2021
e388a26
Fix issue with unions not being marked primitive-only
ahejlsberg Jan 5, 2021
2c2d06d
Allow new alias to be associated with type alias instantiation
ahejlsberg Jan 8, 2021
4507270
Accept new baselines
ahejlsberg Jan 8, 2021
e794cb9
Merge branch 'master' into preserveTypeAliases
ahejlsberg Jan 8, 2021
4e123f5
Revert "Accept new baselines"
ahejlsberg Jan 9, 2021
8881f01
Revert "Allow new alias to be associated with type alias instantiation"
ahejlsberg Jan 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Accept new baselines
  • Loading branch information
ahejlsberg committed Jan 4, 2021
commit 8ef90e7539dada3c7790a2e19355ebb443bf7be7
4 changes: 2 additions & 2 deletions tests/baselines/reference/controlFlowBinaryOrExpression.types
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if (isNodeList(sourceObj)) {
if (isHTMLCollection(sourceObj)) {
>isHTMLCollection(sourceObj) : boolean
>isHTMLCollection : (sourceObj: any) => sourceObj is HTMLCollection
>sourceObj : NodeList | HTMLCollection | { a: string; }
>sourceObj : EventTargetLike

sourceObj.length;
>sourceObj.length : number
Expand All @@ -88,7 +88,7 @@ if (isNodeList(sourceObj) || isHTMLCollection(sourceObj)) {
>isNodeList(sourceObj) || isHTMLCollection(sourceObj) : boolean
>isNodeList(sourceObj) : boolean
>isNodeList : (sourceObj: any) => sourceObj is NodeList
>sourceObj : NodeList | HTMLCollection | { a: string; }
>sourceObj : EventTargetLike
>isHTMLCollection(sourceObj) : boolean
>isHTMLCollection : (sourceObj: any) => sourceObj is HTMLCollection
>sourceObj : { a: string; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function f2() {
>Array.isArray : (arg: any) => arg is any[]
>Array : ArrayConstructor
>isArray : (arg: any) => arg is any[]
>elOrA : string | false | (string | false)[]
>elOrA : (string | false) | (string | false)[]
>elOrA : (string | false)[]
>[elOrA] : (string | false)[]
>elOrA : string | false
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/narrowTypeByInstanceof.types
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (elementA instanceof FileMatch && elementB instanceof FileMatch) {
} else if (elementA instanceof Match && elementB instanceof Match) {
>elementA instanceof Match && elementB instanceof Match : boolean
>elementA instanceof Match : boolean
>elementA : Match | FileMatch
>elementA : FileMatchOrMatch
>Match : typeof Match
>elementB instanceof Match : boolean
>elementB : FileMatchOrMatch
Expand Down
22 changes: 11 additions & 11 deletions tests/baselines/reference/stringLiteralTypesInUnionTypes04.types
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (x === "") {

if (x !== "") {
>x !== "" : boolean
>x : "" | "foo"
>x : T
>"" : ""

let b = x;
Expand All @@ -32,7 +32,7 @@ if (x !== "") {

if (x == "") {
>x == "" : boolean
>x : "" | "foo"
>x : T
>"" : ""

let c = x;
Expand All @@ -42,7 +42,7 @@ if (x == "") {

if (x != "") {
>x != "" : boolean
>x : "" | "foo"
>x : T
>"" : ""

let d = x;
Expand All @@ -51,7 +51,7 @@ if (x != "") {
}

if (x) {
>x : "" | "foo"
>x : T

let e = x;
>e : "foo"
Expand All @@ -60,17 +60,17 @@ if (x) {

if (!x) {
>!x : boolean
>x : "" | "foo"
>x : T

let f = x;
>f : "" | "foo"
>x : "" | "foo"
>f : T
>x : T
}

if (!!x) {
>!!x : boolean
>!x : boolean
>x : "" | "foo"
>x : T

let g = x;
>g : "foo"
Expand All @@ -81,9 +81,9 @@ if (!!!x) {
>!!!x : boolean
>!!x : boolean
>!x : boolean
>x : "" | "foo"
>x : T

let h = x;
>h : "" | "foo"
>x : "" | "foo"
>h : T
>x : T
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (!kindIs(x, "B")) {
>!kindIs(x, "B") : boolean
>kindIs(x, "B") : boolean
>kindIs : { (kind: Kind, is: "A"): kind is "A"; (kind: Kind, is: "B"): kind is "B"; }
>x : "A" | "B"
>x : Kind
>"B" : "B"

let c = x;
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/tryCatchFinallyControlFlow.types
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,14 @@ function notallowed(arg: number) {

state.tag;
>state.tag : "one" | "two" | "three"
>state : { tag: "one"; } | { tag: "two"; } | { tag: "three"; }
>state : State
>tag : "one" | "two" | "three"

if (state.tag !== "one" && state.tag !== "two") {
>state.tag !== "one" && state.tag !== "two" : boolean
>state.tag !== "one" : boolean
>state.tag : "one" | "two" | "three"
>state : { tag: "one"; } | { tag: "two"; } | { tag: "three"; }
>state : State
>tag : "one" | "two" | "three"
>"one" : "one"
>state.tag !== "two" : boolean
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/typeGuardsAsAssertions.types
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function fn<r>(makeSome: () => r): void {
>cond : boolean

result; // Some<r> | None
>result : None | Some<r>
>result : Optional<r>

result = someFrom(isSome(result) ? result.some : makeSome());
>result = someFrom(isSome(result) ? result.some : makeSome()) : { some: r; }
Expand All @@ -63,7 +63,7 @@ export function fn<r>(makeSome: () => r): void {
>isSome(result) ? result.some : makeSome() : r
>isSome(result) : boolean
>isSome : <a>(value: Optional<a>) => value is Some<a>
>result : None | Some<r>
>result : Optional<r>
>result.some : r
>result : Some<r>
>some : r
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class SomeClass2 {
let n: number = this.state?.data; // This should be an error
>n : number
>this.state?.data : string | number
>this.state : { type: "numberVariant"; data: number; } | { type: "stringVariant"; data: string; }
>this.state : State
>this : this
>state : { type: "numberVariant"; data: number; } | { type: "stringVariant"; data: string; }
>state : State
>data : string | number
}
}