Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
1e6c4bf
Add historical coverage: regexp unmatched capture indices
RyanCavanaugh Oct 13, 2026
139d498
Add historical coverage: distributed recursive mapped index
RyanCavanaugh Oct 13, 2026
1dfed63
Add historical coverage: conditional generic prompt inference
RyanCavanaugh Oct 13, 2026
7c943d6
Add historical coverage: contextual return spread pick inference
RyanCavanaugh Oct 13, 2026
6c1287b
Add historical coverage: websocket array buffer like restriction
RyanCavanaugh Oct 13, 2026
f40d8af
Add historical coverage: fetch replacement input compatibility
RyanCavanaugh Oct 13, 2026
c2d4b72
Add historical coverage: css style iterable compatibility
RyanCavanaugh Oct 13, 2026
007631c
Add historical coverage: strict supertype schema
RyanCavanaugh Oct 13, 2026
03bb75f
Add historical coverage: strict supertype injection
RyanCavanaugh Oct 13, 2026
13b9759
Add historical coverage: strict supertype concat
RyanCavanaugh Oct 13, 2026
8340b83
Add historical coverage: message port handler event types
RyanCavanaugh Oct 13, 2026
09e9de3
Add historical coverage: worker implementation handler this
RyanCavanaugh Oct 13, 2026
ae3504f
Add historical coverage: worker global message handler this
RyanCavanaugh Oct 13, 2026
2ac9043
Add historical coverage: worker subtype handler this
RyanCavanaugh Oct 13, 2026
f797473
Add historical coverage: deferred rule message inference
RyanCavanaugh Oct 13, 2026
168d455
Add historical coverage: callback assigned non null auto type
RyanCavanaugh Oct 13, 2026
d90d31d
Add historical coverage: callable weak metadata intersection
RyanCavanaugh Oct 13, 2026
cc322c9
Add historical coverage: callable weak metadata call suggestion
RyanCavanaugh Oct 13, 2026
cab72bf
Add historical coverage: empty mapped parser metadata
RyanCavanaugh Oct 13, 2026
6a3b38c
Add historical coverage: empty mapped jsx props
RyanCavanaugh Oct 13, 2026
465d4da
Add historical coverage: schema callable return metadata
RyanCavanaugh Oct 13, 2026
db1aac8
Add historical coverage: default types exclude ambient packages
RyanCavanaugh Oct 13, 2026
27ab929
Add historical coverage: default types exclude library references
RyanCavanaugh Oct 13, 2026
1720b2f
Add historical coverage: callable constructor union metadata
RyanCavanaugh Oct 13, 2026
eeddfad
Add historical coverage: declaration default import suggestion
RyanCavanaugh Oct 13, 2026
778b159
Add historical coverage: type only synthetic default import
RyanCavanaugh Oct 13, 2026
44ca74c
Add historical coverage: generic value marker
RyanCavanaugh Oct 13, 2026
4d77a58
Add historical coverage: synthetic default callback context
RyanCavanaugh Oct 13, 2026
d3bbb33
Add historical coverage: route component metadata
RyanCavanaugh Oct 13, 2026
f5f0fc1
Add historical coverage: component enhancer return
RyanCavanaugh Oct 13, 2026
e4b57a3
Add historical coverage: template indexed scope options
RyanCavanaugh Oct 13, 2026
1d9ed7f
Add historical coverage: inherited output directory root
RyanCavanaugh Oct 13, 2026
efbeb81
Add historical coverage: skipped circular matcher bases
RyanCavanaugh Oct 13, 2026
0456a0b
Add historical coverage: unknown after typeof early return
RyanCavanaugh Oct 13, 2026
f1072bb
Add historical coverage: literal union after excluded comparisons
RyanCavanaugh Oct 13, 2026
801f8d3
Add historical coverage: compound assignment after excluded literal
RyanCavanaugh Oct 13, 2026
0b0ccea
Add historical coverage: excluded numeric literal after decrement
RyanCavanaugh Oct 13, 2026
712d6ee
Add historical coverage: redundant numeric literal comparison
RyanCavanaugh Oct 13, 2026
98b2122
Add historical coverage: dynamic declaration default
RyanCavanaugh Oct 14, 2026
d1aa7a4
Add historical coverage: skipped implicit handler parameters
RyanCavanaugh Oct 14, 2026
e647011
Add historical coverage: numeric compound assignment after excluded zero
RyanCavanaugh Oct 14, 2026
ce821f4
Add historical coverage: missing types condition default sidecar
RyanCavanaugh Oct 14, 2026
85198ff
Add historical coverage: default types exclude ambient module imports
RyanCavanaugh Oct 14, 2026
71704ca
Add historical coverage: embedded numeric compound assignment after e…
RyanCavanaugh Oct 14, 2026
e93baf5
Add historical coverage: numeric compound assignment in while loop af…
RyanCavanaugh Oct 14, 2026
2f401c9
Add historical coverage: numeric compound assignment in for update af…
RyanCavanaugh Oct 14, 2026
ed45d50
Add historical coverage: identity of instantiated mapped intersection
RyanCavanaugh Oct 14, 2026
a6c2f14
Add historical coverage: numeric compound assignment in else branch
RyanCavanaugh Oct 14, 2026
b82cc4b
Add historical coverage: numeric compound assignment after break
RyanCavanaugh Oct 14, 2026
8d034fd
Add historical coverage: numeric compound assignment after continue
RyanCavanaugh Oct 14, 2026
a3f1f15
Add historical coverage: numeric compound assignment in callback
RyanCavanaugh Oct 14, 2026
15572b7
Add historical coverage: numeric property compound assignment after d…
RyanCavanaugh Oct 14, 2026
9597cc3
Add historical coverage: numeric compound assignments in nonzero branch
RyanCavanaugh Oct 14, 2026
678cdc0
Add historical coverage: numeric compound assignments after conjunction
RyanCavanaugh Oct 14, 2026
a06c01b
Add historical coverage: indexed any predicate in for loop
RyanCavanaugh Oct 14, 2026
550ee31
Add historical coverage: default weak map inferred property assignment
RyanCavanaugh Oct 14, 2026
400ae31
Add historical coverage: jsx children excess property suppression
RyanCavanaugh Oct 14, 2026
ce28ae5
Add historical coverage: namespace function reserved default parameter
RyanCavanaugh Oct 14, 2026
431f09a
Add historical coverage: promise all array assertion overlap
RyanCavanaugh Oct 14, 2026
7e42592
Add historical coverage: object entries partial indexed write
RyanCavanaugh Oct 14, 2026
025d4b5
Add historical coverage: object from entries spread possible duplicates
RyanCavanaugh Oct 14, 2026
20704e5
Add historical coverage: object entries object array narrowing
RyanCavanaugh Oct 14, 2026
f7c9ae5
Add historical coverage: object from entries additional property
RyanCavanaugh Oct 14, 2026
8da7448
Add historical coverage: chained filter predicate inference
RyanCavanaugh Oct 14, 2026
16796f0
Add historical coverage: object from entries branded template keys
RyanCavanaugh Oct 15, 2026
d4b27d7
Add historical coverage: contextual return recursive pattern arguments
RyanCavanaugh Oct 15, 2026
0340990
Add historical coverage: contextual return array pattern callback
RyanCavanaugh Oct 15, 2026
a1e41cd
Add historical coverage: object entries map broad key lookup
RyanCavanaugh Oct 15, 2026
1329942
Add historical coverage: object entries symbol value arity
RyanCavanaugh Oct 15, 2026
7612d5a
Add historical coverage: new target undefined equality
RyanCavanaugh Oct 15, 2026
b513608
Add historical coverage: logical not undefined comparison
RyanCavanaugh Oct 15, 2026
ec8722f
Add historical coverage: generic contextual overload composition
RyanCavanaugh Oct 15, 2026
bf88198
Add historical coverage: dom iterable generic dataset keys
RyanCavanaugh Oct 15, 2026
9239db3
Add historical coverage: dom iterable symbol mapped value
RyanCavanaugh Oct 15, 2026
209d6d6
Add historical coverage: object entries generic mapped values
RyanCavanaugh Oct 15, 2026
43d9c73
Add historical coverage: large discriminant union array predicate
RyanCavanaugh Oct 15, 2026
0052a48
Add historical coverage: async callback state union inference
RyanCavanaugh Oct 15, 2026
61c0880
Add historical coverage: iterator nullish value assignment
RyanCavanaugh Oct 15, 2026
6994b7f
Add historical coverage: explicit alwaysStrict false policy
RyanCavanaugh Oct 15, 2026
07df8ea
Add historical coverage: nullable enum switch receiver
RyanCavanaugh Oct 15, 2026
2a17035
Cover truthy re-reads of an undefined object property
RyanCavanaugh Oct 15, 2026
f33913b
Cover nullish fallbacks after correlated label narrowing
RyanCavanaugh Oct 15, 2026
15c4613
Cover non-strict optional-never result guards
RyanCavanaugh Oct 15, 2026
02466a3
Cover common-supertype inference through deep partial intersections
RyanCavanaugh Oct 15, 2026
3dc1c33
Cover loop inference through nullable array metadata
RyanCavanaugh Oct 15, 2026
ee2e21a
Cover baseUrl removal in parsed configurations
RyanCavanaugh Oct 15, 2026
5d324d8
Cover distinct defaults behind type-only export stars
RyanCavanaugh Oct 15, 2026
3825176
Cover export-star ambiguity between local default bindings
RyanCavanaugh Oct 15, 2026
e3f6a35
Cover distinct defaults through a transitive export star
RyanCavanaugh Oct 15, 2026
69a3b6c
Cover array-shaped DOM observer callbacks
RyanCavanaugh Oct 15, 2026
0ef2071
Cover explicitly typed ResizeObserver callbacks
RyanCavanaugh Oct 15, 2026
62da6f2
Cover directory-reader array callbacks and readonly promises
RyanCavanaugh Oct 15, 2026
96844cb
Test fetch compatibility after copying an overload signature
RyanCavanaugh Oct 15, 2026
f4be4f8
Test contextual fetch input narrowing to Request.url
RyanCavanaugh Oct 15, 2026
800b05e
Test generic return context for optional class fields
RyanCavanaugh Oct 15, 2026
b21ed71
Test contextual factory results assigned to optional class fields
RyanCavanaugh Oct 15, 2026
4a84c00
Test module keyword on an instantiated runtime namespace
RyanCavanaugh Oct 15, 2026
c83c719
Cover conditional inference from function and value unions
RyanCavanaugh Oct 15, 2026
d7b7715
Cover asserted assignment to readonly parameter properties
RyanCavanaugh Oct 15, 2026
b9009d7
Cover asserted writes through generic Partial indexes
RyanCavanaugh Oct 15, 2026
5e107b1
Cover valid NodeNext conditional exports fallback
RyanCavanaugh Oct 16, 2026
4811a5e
Cover CommonJS conditional exports require-to-default fallback
RyanCavanaugh Oct 16, 2026
894de51
Cover implicit rootDir with inherited include and outDir
RyanCavanaugh Oct 16, 2026
e2b31a5
Add coverage for require-to-types exports fallback
RyanCavanaugh Oct 16, 2026
0c1d783
Add coverage for node-to-types exports fallback
RyanCavanaugh Oct 16, 2026
6bb608f
Add coverage for types-to-import exports fallback
RyanCavanaugh Oct 16, 2026
2e435c1
Cover base globals lost through excluded automatic types
RyanCavanaugh Oct 16, 2026
3d0d35a
Add direct external-files config-root coverage
RyanCavanaugh Oct 16, 2026
2b678d9
Cover generic calls after excluding strings
RyanCavanaugh Oct 16, 2026
e846065
Add coverage for optional regex captures assigned to string arrays
RyanCavanaugh Oct 16, 2026
e9c6b98
Add coverage for structural TreeWalker mocks
RyanCavanaugh Oct 16, 2026
2a6f82b
Add coverage for string-only keys of DOM Elements
RyanCavanaugh Oct 16, 2026
39f81f5
Add historical DOM base-element assignment coverage
RyanCavanaugh Oct 16, 2026
bd8b1f6
Add historical single-parameter replacement callback coverage
RyanCavanaugh Oct 16, 2026
396d27f
Add historical RegExp constructor match-groups coverage
RyanCavanaugh Oct 16, 2026
bbc43bf
Add historical global RegExp match iteration coverage
RyanCavanaugh Oct 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 37 additions & 0 deletions tsc/internal/execute/tsctests/tsc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,43 @@ func TestTscCommandline(t *testing.T) {
},
}

for _, value := range []string{"false", "true", "omitted"} {
option := ""
if value != "omitted" {
option = `, "alwaysStrict": ` + value
}
testCases = append(testCases, &tscInput{
subScenario: "alwaysStrict " + value + " in configuration",
files: FileMap{
"/home/src/workspaces/project/tsconfig.json": fmt.Sprintf(`{"compilerOptions": {"target": "es2015"%s}}`, option),
"/home/src/workspaces/project/index.ts": "export {};",
},
commandLineArgs: []string{"--noEmit"},
})
}
for _, setting := range []struct {
name string
config string
base string
}{
{"relative", `{"compilerOptions": {"target": "es2015", "baseUrl": "."}}`, ""},
{"empty", `{"compilerOptions": {"target": "es2015", "baseUrl": ""}}`, ""},
{"inherited", `{"extends": "./base.json"}`, `{"compilerOptions": {"target": "es2015", "baseUrl": "."}}`},
{"omitted", `{"compilerOptions": {"target": "es2015"}}`, ""},
} {
files := FileMap{
"/home/src/workspaces/project/tsconfig.json": setting.config,
"/home/src/workspaces/project/index.ts": "export {};",
}
if setting.base != "" {
files["/home/src/workspaces/project/base.json"] = setting.base
}
testCases = append(testCases, &tscInput{
subScenario: "baseUrl " + setting.name + " in configuration",
files: files,
commandLineArgs: []string{"--noEmit"},
})
}
for _, testCase := range testCases {
testCase.run(t, "commandLine")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//// [tests/cases/compiler/assertedGenericPartialIndexedAssignment.ts] ////

=== assertedGenericPartialIndexedAssignment.ts ===
function write<T extends Record<string, unknown>>(values: Partial<T>, key: string) {
>write : Symbol(write, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 0))
>T : Symbol(T, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 15))
>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))
>values : Symbol(values, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 50))
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 15))
>key : Symbol(key, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 69))

(values[key] as unknown) = 0;
>values : Symbol(values, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 50))
>key : Symbol(key, Decl(assertedGenericPartialIndexedAssignment.ts, 0, 69))
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//// [tests/cases/compiler/assertedGenericPartialIndexedAssignment.ts] ////

=== assertedGenericPartialIndexedAssignment.ts ===
function write<T extends Record<string, unknown>>(values: Partial<T>, key: string) {
>write : <T extends Record<string, unknown>>(values: Partial<T>, key: string) => void
>values : Partial<T>
>key : string

(values[key] as unknown) = 0;
>(values[key] as unknown) = 0 : 0
>(values[key] as unknown) : unknown
>values[key] as unknown : unknown
>values[key] : T[string] | undefined
>values : Partial<T>
>key : string
>0 : 0
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//// [tests/cases/compiler/assertedReadonlyParameterPropertyAssignment.ts] ////

=== assertedReadonlyParameterPropertyAssignment.ts ===
class ReadonlyState {
>ReadonlyState : Symbol(ReadonlyState, Decl(assertedReadonlyParameterPropertyAssignment.ts, 0, 0))

constructor(readonly value: object) {}
>value : Symbol(ReadonlyState.value, Decl(assertedReadonlyParameterPropertyAssignment.ts, 1, 16))

clear() {
>clear : Symbol(ReadonlyState.clear, Decl(assertedReadonlyParameterPropertyAssignment.ts, 1, 42))

(this.value as unknown) = null;
>this.value : Symbol(ReadonlyState.value, Decl(assertedReadonlyParameterPropertyAssignment.ts, 1, 16))
>this : Symbol(ReadonlyState, Decl(assertedReadonlyParameterPropertyAssignment.ts, 0, 0))
>value : Symbol(ReadonlyState.value, Decl(assertedReadonlyParameterPropertyAssignment.ts, 1, 16))
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//// [tests/cases/compiler/assertedReadonlyParameterPropertyAssignment.ts] ////

=== assertedReadonlyParameterPropertyAssignment.ts ===
class ReadonlyState {
>ReadonlyState : ReadonlyState

constructor(readonly value: object) {}
>value : object

clear() {
>clear : () => void

(this.value as unknown) = null;
>(this.value as unknown) = null : null
>(this.value as unknown) : unknown
>this.value as unknown : unknown
>this.value : object
>this : this
>value : object
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//// [tests/cases/compiler/callableConstructorUnionMetadata.ts] ////

=== callableConstructorUnionMetadata.ts ===
type Component<Props> = ((props: Props) => number) | (new (props: Props) => object);
>Component : Symbol(Component, Decl(callableConstructorUnionMetadata.ts, 0, 0))
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 0, 15))
>props : Symbol(props, Decl(callableConstructorUnionMetadata.ts, 0, 26))
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 0, 15))
>props : Symbol(props, Decl(callableConstructorUnionMetadata.ts, 0, 59))
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 0, 15))

type Field<Props> = Component<Props> & { testIds?: {} };
>Field : Symbol(Field, Decl(callableConstructorUnionMetadata.ts, 0, 84))
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 1, 11))
>Component : Symbol(Component, Decl(callableConstructorUnionMetadata.ts, 0, 0))
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 1, 11))
>testIds : Symbol(testIds, Decl(callableConstructorUnionMetadata.ts, 1, 40))

declare const component: <Props>(props: Props) => number;
>component : Symbol(component, Decl(callableConstructorUnionMetadata.ts, 3, 13))
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 3, 26))
>props : Symbol(props, Decl(callableConstructorUnionMetadata.ts, 3, 33))
>Props : Symbol(Props, Decl(callableConstructorUnionMetadata.ts, 3, 26))

const field: Field<string> = component;
>field : Symbol(field, Decl(callableConstructorUnionMetadata.ts, 4, 5))
>Field : Symbol(Field, Decl(callableConstructorUnionMetadata.ts, 0, 84))
>component : Symbol(component, Decl(callableConstructorUnionMetadata.ts, 3, 13))

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//// [tests/cases/compiler/callableConstructorUnionMetadata.ts] ////

=== callableConstructorUnionMetadata.ts ===
type Component<Props> = ((props: Props) => number) | (new (props: Props) => object);
>Component : Component<Props>
>props : Props
>props : Props

type Field<Props> = Component<Props> & { testIds?: {} };
>Field : Field<Props>
>testIds : {} | undefined

declare const component: <Props>(props: Props) => number;
>component : <Props>(props: Props) => number
>props : Props

const field: Field<string> = component;
>field : Field<string>
>component : <Props>(props: Props) => number

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//// [tests/cases/compiler/callableWeakMetadata.ts] ////

=== callableWeakMetadata.ts ===
type Initializer = (() => number) & { mutators?: [] };
>Initializer : Symbol(Initializer, Decl(callableWeakMetadata.ts, 0, 0))
>mutators : Symbol(mutators, Decl(callableWeakMetadata.ts, 0, 37))

declare function createStore(initializer: Initializer): void;
>createStore : Symbol(createStore, Decl(callableWeakMetadata.ts, 0, 54))
>initializer : Symbol(initializer, Decl(callableWeakMetadata.ts, 2, 29))
>Initializer : Symbol(Initializer, Decl(callableWeakMetadata.ts, 0, 0))

createStore(() => 1);
>createStore : Symbol(createStore, Decl(callableWeakMetadata.ts, 0, 54))

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//// [tests/cases/compiler/callableWeakMetadata.ts] ////

=== callableWeakMetadata.ts ===
type Initializer = (() => number) & { mutators?: [] };
>Initializer : Initializer
>mutators : [] | undefined

declare function createStore(initializer: Initializer): void;
>createStore : (initializer: Initializer) => void
>initializer : Initializer

createStore(() => 1);
>createStore(() => 1) : void
>createStore : (initializer: Initializer) => void
>() => 1 : () => number
>1 : 1

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//// [tests/cases/compiler/callableWeakMetadataCallSuggestion.ts] ////

=== callableWeakMetadataCallSuggestion.ts ===
type Initializer = (() => number) & { mutators?: [] };
>Initializer : Symbol(Initializer, Decl(callableWeakMetadataCallSuggestion.ts, 0, 0))
>mutators : Symbol(mutators, Decl(callableWeakMetadataCallSuggestion.ts, 0, 37))

declare function createStore(initializer: Initializer): void;
>createStore : Symbol(createStore, Decl(callableWeakMetadataCallSuggestion.ts, 0, 54))
>initializer : Symbol(initializer, Decl(callableWeakMetadataCallSuggestion.ts, 2, 29))
>Initializer : Symbol(Initializer, Decl(callableWeakMetadataCallSuggestion.ts, 0, 0))

declare const initializer: () => any;
>initializer : Symbol(initializer, Decl(callableWeakMetadataCallSuggestion.ts, 3, 13))

createStore(initializer);
>createStore : Symbol(createStore, Decl(callableWeakMetadataCallSuggestion.ts, 0, 54))
>initializer : Symbol(initializer, Decl(callableWeakMetadataCallSuggestion.ts, 3, 13))

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//// [tests/cases/compiler/callableWeakMetadataCallSuggestion.ts] ////

=== callableWeakMetadataCallSuggestion.ts ===
type Initializer = (() => number) & { mutators?: [] };
>Initializer : Initializer
>mutators : [] | undefined

declare function createStore(initializer: Initializer): void;
>createStore : (initializer: Initializer) => void
>initializer : Initializer

declare const initializer: () => any;
>initializer : () => any

createStore(initializer);
>createStore(initializer) : void
>createStore : (initializer: Initializer) => void
>initializer : () => any

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//// [tests/cases/compiler/callbackAssignedNonNull.ts] ////

=== callbackAssignedNonNull.ts ===
declare function initialize(callback: (cancel: () => void) => void): void;
>initialize : Symbol(initialize, Decl(callbackAssignedNonNull.ts, 0, 0))
>callback : Symbol(callback, Decl(callbackAssignedNonNull.ts, 0, 28))
>cancel : Symbol(cancel, Decl(callbackAssignedNonNull.ts, 0, 39))

function start() {
>start : Symbol(start, Decl(callbackAssignedNonNull.ts, 0, 74))

let cancel;
>cancel : Symbol(cancel, Decl(callbackAssignedNonNull.ts, 3, 7))

initialize(value => {
>initialize : Symbol(initialize, Decl(callbackAssignedNonNull.ts, 0, 0))
>value : Symbol(value, Decl(callbackAssignedNonNull.ts, 4, 15))

cancel = value;
>cancel : Symbol(cancel, Decl(callbackAssignedNonNull.ts, 3, 7))
>value : Symbol(value, Decl(callbackAssignedNonNull.ts, 4, 15))

});
cancel!();
>cancel : Symbol(cancel, Decl(callbackAssignedNonNull.ts, 3, 7))
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//// [tests/cases/compiler/callbackAssignedNonNull.ts] ////

=== callbackAssignedNonNull.ts ===
declare function initialize(callback: (cancel: () => void) => void): void;
>initialize : (callback: (cancel: () => void) => void) => void
>callback : (cancel: () => void) => void
>cancel : () => void

function start() {
>start : () => void

let cancel;
>cancel : any

initialize(value => {
>initialize(value => { cancel = value; }) : void
>initialize : (callback: (cancel: () => void) => void) => void
>value => { cancel = value; } : (value: () => void) => void
>value : () => void

cancel = value;
>cancel = value : () => void
>cancel : any
>value : () => void

});
cancel!();
>cancel!() : any
>cancel! : any
>cancel : any
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//// [tests/cases/compiler/chainedFilterPredicateInference.ts] ////

//// [chainedFilterPredicateInference.ts]
declare const items: { id: number }[];
declare const registry: { [id: number]: { [frame: number]: unknown } };

items
.filter(item => true)
.filter(item => !registry[item.id])
.forEach(item => item.id);


//// [chainedFilterPredicateInference.js]
"use strict";
items
.filter(item => true)
.filter(item => !registry[item.id])
.forEach(item => item.id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//// [tests/cases/compiler/chainedFilterPredicateInference.ts] ////

=== chainedFilterPredicateInference.ts ===
declare const items: { id: number }[];
>items : Symbol(items, Decl(chainedFilterPredicateInference.ts, 0, 13))
>id : Symbol(id, Decl(chainedFilterPredicateInference.ts, 0, 22))

declare const registry: { [id: number]: { [frame: number]: unknown } };
>registry : Symbol(registry, Decl(chainedFilterPredicateInference.ts, 1, 13))
>id : Symbol(id, Decl(chainedFilterPredicateInference.ts, 1, 27))
>frame : Symbol(frame, Decl(chainedFilterPredicateInference.ts, 1, 43))

items
>items .filter(item => true) .filter(item => !registry[item.id]) .forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
>items .filter(item => true) .filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>items .filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>items : Symbol(items, Decl(chainedFilterPredicateInference.ts, 0, 13))

.filter(item => true)
>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(chainedFilterPredicateInference.ts, 4, 12))

.filter(item => !registry[item.id])
>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(chainedFilterPredicateInference.ts, 5, 12))
>registry : Symbol(registry, Decl(chainedFilterPredicateInference.ts, 1, 13))
>item.id : Symbol(id, Decl(chainedFilterPredicateInference.ts, 0, 22))
>item : Symbol(item, Decl(chainedFilterPredicateInference.ts, 5, 12))
>id : Symbol(id, Decl(chainedFilterPredicateInference.ts, 0, 22))

.forEach(item => item.id);
>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(chainedFilterPredicateInference.ts, 6, 13))
>item.id : Symbol(id, Decl(chainedFilterPredicateInference.ts, 0, 22))
>item : Symbol(item, Decl(chainedFilterPredicateInference.ts, 6, 13))
>id : Symbol(id, Decl(chainedFilterPredicateInference.ts, 0, 22))

Loading
Loading