Accept new baselines

This commit is contained in:
Anders Hejlsberg
2024-08-08 10:26:26 -07:00
parent b60fbc053d
commit 7f7ccf63b9
8 changed files with 1967 additions and 52 deletions

View File

@@ -3763,8 +3763,8 @@ declare namespace ts {
BooleanKeyword = 136,
ConstructorKeyword = 137,
DeclareKeyword = 138,
DeferredKeyword = 139,
GetKeyword = 140,
GetKeyword = 139,
ImmediateKeyword = 140,
InferKeyword = 141,
IntrinsicKeyword = 142,
IsKeyword = 143,
@@ -3961,7 +3961,7 @@ declare namespace ts {
JSDocImplementsTag = 330,
JSDocAuthorTag = 331,
JSDocDeprecatedTag = 332,
JSDocDeferredTag = 333,
JSDocImmediateTag = 333,
JSDocClassTag = 334,
JSDocPublicTag = 335,
JSDocPrivateTag = 336,
@@ -4106,7 +4106,6 @@ declare namespace ts {
| SyntaxKind.DebuggerKeyword
| SyntaxKind.DeclareKeyword
| SyntaxKind.DefaultKeyword
| SyntaxKind.DeferredKeyword
| SyntaxKind.DeleteKeyword
| SyntaxKind.DoKeyword
| SyntaxKind.ElseKeyword
@@ -4121,6 +4120,7 @@ declare namespace ts {
| SyntaxKind.GetKeyword
| SyntaxKind.GlobalKeyword
| SyntaxKind.IfKeyword
| SyntaxKind.ImmediateKeyword
| SyntaxKind.ImplementsKeyword
| SyntaxKind.ImportKeyword
| SyntaxKind.InferKeyword
@@ -4170,7 +4170,7 @@ declare namespace ts {
| SyntaxKind.WhileKeyword
| SyntaxKind.WithKeyword
| SyntaxKind.YieldKeyword;
type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeferredKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ImmediateKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
@@ -4227,9 +4227,9 @@ declare namespace ts {
In = 8192,
Out = 16384,
Decorator = 32768,
Deferred = 65536,
Immediate = 65536,
Deprecated = 131072,
JSDocDeferred = 262144,
JSDocImmediate = 262144,
HasComputedJSDocModifiers = 268435456,
HasComputedFlags = 536870912,
AccessibilityModifier = 7,
@@ -4387,8 +4387,8 @@ declare namespace ts {
type ConstKeyword = ModifierToken<SyntaxKind.ConstKeyword>;
type DeclareKeyword = ModifierToken<SyntaxKind.DeclareKeyword>;
type DefaultKeyword = ModifierToken<SyntaxKind.DefaultKeyword>;
type DeferredKeyword = ModifierToken<SyntaxKind.DeferredKeyword>;
type ExportKeyword = ModifierToken<SyntaxKind.ExportKeyword>;
type ImmediateKeyword = ModifierToken<SyntaxKind.ImmediateKeyword>;
type InKeyword = ModifierToken<SyntaxKind.InKeyword>;
type PrivateKeyword = ModifierToken<SyntaxKind.PrivateKeyword>;
type ProtectedKeyword = ModifierToken<SyntaxKind.ProtectedKeyword>;
@@ -4397,7 +4397,7 @@ declare namespace ts {
type OutKeyword = ModifierToken<SyntaxKind.OutKeyword>;
type OverrideKeyword = ModifierToken<SyntaxKind.OverrideKeyword>;
type StaticKeyword = ModifierToken<SyntaxKind.StaticKeyword>;
type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | DeferredKeyword | ExportKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
type Modifier = AbstractKeyword | AccessorKeyword | AsyncKeyword | ConstKeyword | DeclareKeyword | DefaultKeyword | ExportKeyword | ImmediateKeyword | InKeyword | PrivateKeyword | ProtectedKeyword | PublicKeyword | OutKeyword | OverrideKeyword | ReadonlyKeyword | StaticKeyword;
type ModifierLike = Modifier | Decorator;
type AccessibilityModifier = PublicKeyword | PrivateKeyword | ProtectedKeyword;
type ParameterPropertyModifier = AccessibilityModifier | ReadonlyKeyword;
@@ -5727,8 +5727,8 @@ declare namespace ts {
interface JSDocDeprecatedTag extends JSDocTag {
kind: SyntaxKind.JSDocDeprecatedTag;
}
interface JSDocDeferredTag extends JSDocTag {
kind: SyntaxKind.JSDocDeferredTag;
interface JSDocImmediateTag extends JSDocTag {
kind: SyntaxKind.JSDocImmediateTag;
}
interface JSDocClassTag extends JSDocTag {
readonly kind: SyntaxKind.JSDocClassTag;
@@ -7745,8 +7745,8 @@ declare namespace ts {
updateJSDocUnknownTag(node: JSDocUnknownTag, tagName: Identifier, comment: string | NodeArray<JSDocComment> | undefined): JSDocUnknownTag;
createJSDocDeprecatedTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
updateJSDocDeprecatedTag(node: JSDocDeprecatedTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeprecatedTag;
createJSDocDeferredTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeferredTag;
updateJSDocDeferredTag(node: JSDocDeferredTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocDeferredTag;
createJSDocImmediateTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocImmediateTag;
updateJSDocImmediateTag(node: JSDocImmediateTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocImmediateTag;
createJSDocOverrideTag(tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
updateJSDocOverrideTag(node: JSDocOverrideTag, tagName: Identifier | undefined, comment?: string | NodeArray<JSDocComment>): JSDocOverrideTag;
createJSDocThrowsTag(tagName: Identifier, typeExpression: JSDocTypeExpression | undefined, comment?: string | NodeArray<JSDocComment>): JSDocThrowsTag;
@@ -8600,8 +8600,8 @@ declare namespace ts {
function getJSDocOverrideTagNoCache(node: Node): JSDocOverrideTag | undefined;
/** Gets the JSDoc deprecated tag for the node if present */
function getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag | undefined;
/** Gets the JSDoc deferred tag for the node if present */
function getJSDocDeferredTag(node: Node): JSDocDeferredTag | undefined;
/** Gets the JSDoc immediate tag for the node if present */
function getJSDocImmediateTag(node: Node): JSDocImmediateTag | undefined;
/** Gets the JSDoc enum tag for the node if present */
function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined;
/** Gets the JSDoc this tag for the node if present */
@@ -9046,7 +9046,7 @@ declare namespace ts {
function isJSDocOverrideTag(node: Node): node is JSDocOverrideTag;
function isJSDocOverloadTag(node: Node): node is JSDocOverloadTag;
function isJSDocDeprecatedTag(node: Node): node is JSDocDeprecatedTag;
function isJSDocDeferredTag(node: Node): node is JSDocDeferredTag;
function isJSDocImmediateTag(node: Node): node is JSDocImmediateTag;
function isJSDocSeeTag(node: Node): node is JSDocSeeTag;
function isJSDocEnumTag(node: Node): node is JSDocEnumTag;
function isJSDocParameterTag(node: Node): node is JSDocParameterTag;

View File

@@ -83,7 +83,7 @@
// * [11,2,22,1].sort((a, b) => a - b)
// * ```
// */
// sort(compareFn?: (a: T, b: T) => number): this;
// sort(/** @immediate */ compareFn?: (a: T, b: T) => number): this;
// /**
// * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
// * @param start The zero-based location in the array from which to start removing elements.
@@ -124,7 +124,7 @@
// * @param thisArg An object to which the this keyword can refer in the predicate function.
// * If thisArg is omitted, undefined is used as the this value.
// */
// every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
// every<S extends T>(/** @immediate */ predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
// /**
// * Determines whether all the members of an array satisfy the specified test.
// * @param predicate A function that accepts up to three arguments. The every method calls
@@ -133,7 +133,7 @@
// * @param thisArg An object to which the this keyword can refer in the predicate function.
// * If thisArg is omitted, undefined is used as the this value.
// */
// every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
// every(/** @immediate */ predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
// /**
// * Determines whether the specified callback function returns true for any element of an array.
// * @param predicate A function that accepts up to three arguments. The some method calls
@@ -142,57 +142,57 @@
// * @param thisArg An object to which the this keyword can refer in the predicate function.
// * If thisArg is omitted, undefined is used as the this value.
// */
// some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
// some(/** @immediate */ predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
// /**
// * Performs the specified action for each element in an array.
// * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
// forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
// forEach(/** @immediate */ callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
// /**
// * Calls a defined callback function on each element of an array, and returns an array that contains the results.
// * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
// map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
// map<U>(/** @immediate */ callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
// /**
// * Returns the elements of an array that meet the condition specified in a callback function.
// * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
// */
// filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
// filter<S extends T>(/** @immediate */ predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
// /**
// * Returns the elements of an array that meet the condition specified in a callback function.
// * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
// */
// filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
// filter(/** @immediate */ predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
// /**
// * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
// reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
// reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
// reduce(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
// reduce(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
// /**
// * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
// reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
// reduce<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
// /**
// * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
// reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
// reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
// reduceRight(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
// reduceRight(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
// /**
// * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
// reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
// reduceRight<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
//
// [n: number]: T;
// }|>
@@ -336,7 +336,7 @@
// * [11,2,22,1].sort((a, b) => a - b)
// * ```
// */
// sort(compareFn?: (a: T, b: T) => number): this;
// sort(/** @immediate */ compareFn?: (a: T, b: T) => number): this;
// /**
// * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
// * @param start The zero-based location in the array from which to start removing elements.
@@ -377,7 +377,7 @@
// * @param thisArg An object to which the this keyword can refer in the predicate function.
// * If thisArg is omitted, undefined is used as the this value.
// */
// every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
// every<S extends T>(/** @immediate */ predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
// /**
// * Determines whether all the members of an array satisfy the specified test.
// * @param predicate A function that accepts up to three arguments. The every method calls
@@ -386,7 +386,7 @@
// * @param thisArg An object to which the this keyword can refer in the predicate function.
// * If thisArg is omitted, undefined is used as the this value.
// */
// every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
// every(/** @immediate */ predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
// /**
// * Determines whether the specified callback function returns true for any element of an array.
// * @param predicate A function that accepts up to three arguments. The some method calls
@@ -395,57 +395,57 @@
// * @param thisArg An object to which the this keyword can refer in the predicate function.
// * If thisArg is omitted, undefined is used as the this value.
// */
// some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
// some(/** @immediate */ predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
// /**
// * Performs the specified action for each element in an array.
// * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
// forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
// forEach(/** @immediate */ callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
// /**
// * Calls a defined callback function on each element of an array, and returns an array that contains the results.
// * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
// */
// map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
// map<U>(/** @immediate */ callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
// /**
// * Returns the elements of an array that meet the condition specified in a callback function.
// * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
// */
// filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
// filter<S extends T>(/** @immediate */ predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
// /**
// * Returns the elements of an array that meet the condition specified in a callback function.
// * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
// * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
// */
// filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
// filter(/** @immediate */ predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
// /**
// * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
// reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
// reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
// reduce(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
// reduce(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
// /**
// * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
// reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
// reduce<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
// /**
// * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
// reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
// reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
// reduceRight(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
// reduceRight(/** @immediate */ callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
// /**
// * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
// * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
// * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
// */
// reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
// reduceRight<U>(/** @immediate */ callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
//
// [n: number]: T;
// }|>

View File

@@ -19,14 +19,14 @@
// * @param onrejected The callback to execute when the Promise is rejected.
// * @returns A Promise for the completion of which ever callback is executed.
// */
// then<TResult1 = T, TResult2 = never>(/** @deferred */ onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, /** @deferred */ onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
// then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
//
// /**
// * Attaches a callback for only the rejection of the Promise.
// * @param onrejected The callback to execute when the Promise is rejected.
// * @returns A Promise for the completion of the callback.
// */
// catch<TResult = never>(/** @deferred */ onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
// catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
// }|>
//
// /**
@@ -80,14 +80,14 @@
// * @param onrejected The callback to execute when the Promise is rejected.
// * @returns A Promise for the completion of which ever callback is executed.
// */
// then<TResult1 = T, TResult2 = never>(/** @deferred */ onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, /** @deferred */ onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
// then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
//
// /**
// * Attaches a callback for only the rejection of the Promise.
// * @param onrejected The callback to execute when the Promise is rejected.
// * @returns A Promise for the completion of the callback.
// */
// catch<TResult = never>(/** @deferred */ onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
// catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
// }|>
//
// /**

View File

@@ -0,0 +1,259 @@
immediateCallbacks.ts(119,22): error TS2874: An 'immediate' parameter must have a type that permits functions.
immediateCallbacks.ts(120,22): error TS2874: An 'immediate' parameter must have a type that permits functions.
immediateCallbacks.ts(121,22): error TS2874: An 'immediate' parameter must have a type that permits functions.
immediateCallbacks.ts(128,13): error TS2874: An 'immediate' parameter must have a type that permits functions.
immediateCallbacks.ts(129,13): error TS2874: An 'immediate' parameter must have a type that permits functions.
immediateCallbacks.ts(130,13): error TS2874: An 'immediate' parameter must have a type that permits functions.
immediateCallbacks.ts(131,14): error TS1070: 'immediate' modifier cannot appear on a type member.
==== immediateCallbacks.ts (7 errors) ====
declare function deferred(cb: () => void): void;
declare function immediate1(immediate cb: () => void): void;
declare function immediate2(/** @immediate */ cb: () => void): void;
declare function immediate3(/** @immediate */ immediate cb: () => void): void;
function f01() {
let x: string | number = "OK";
deferred(() => {
x = 42;
});
x; // string
}
function f02() {
let x: string | number = "OK";
immediate1(() => {
x = 42;
});
x; // string | number
}
function f03() {
let x: string | number = "OK";
immediate2(() => {
x = 42;
});
x; // string | number
}
function f04() {
let x: string | number = "OK";
immediate3(() => {
x = 42;
});
x; // string | number
}
// Parameter is considered immediate if one or more overloads include the modifier in that parameter position
declare function overloaded<T>(cb: (x: T) => T): void;
declare function overloaded<T>(cb: (x: T, y: T) => T): void;
declare function overloaded(immediate cb: (...args: any) => any): void;
function f05() {
let x: string | number = "OK";
overloaded(() => {
x = 42;
});
x; // string | number
}
// immediate is permitted on a rest parameter
declare function invokeDeferred(...args: ((...args: any) => any)[]): void;
declare function invokeImmediate(immediate ...args: ((...args: any) => any)[]): void;
function f06() {
let a = [];
a.push("abc");
a; // string[]
invokeImmediate(
() => {
a; // string[]
a.push(42);
a; // (string | number)[]
},
() => {
a; // string[]
a.push(true);
a; // (string | boolean)[]
}
);
a; // (string | number | boolean)[]
}
function f07() {
let a = [];
a.push("abc");
a; // string[]
invokeDeferred(
() => {
a; // string[]
a.push(42);
a; // (string | number)[]
},
() => {
a; // string[]
a.push(true);
a; // (string | boolean)[]
}
);
a; // string[]
}
// immediate modifier must precede public/private/protected/readonly
class CC {
constructor(immediate public readonly x: () => void) {}
}
// immediate requires parameter to have type that permits functions
declare function f10(immediate f: () => void): void;
declare function f11(immediate f: Function): void;
declare function f12(immediate f: any): void;
declare function f13(immediate f: object): void;
declare function f14(immediate f: {}): void;
declare function f15(immediate f: unknown): void;
declare function f16<T extends Function>(immediate f: T): void;
declare function f17<T extends (...args: any) => any>(immediate f: T): void;
declare function f18<T extends string | (() => void)>(immediate f: T): void;
declare function f20(immediate ...funcs: Function[]): void;
declare function f21<T extends ((...args: any) => any)[]>(immediate ...funcs: T): void;
declare function f22<T extends (string | (() => void))[]>(immediate ...funcs: T): void;
declare function f23<T extends string[] | (() => void)[]>(immediate ...funcs: T): void;
declare function f24<T extends (() => void)[]>(immediate ...funcs: T | string[]): void;
declare function f30(immediate f: { foo(): void }): void;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2874: An 'immediate' parameter must have a type that permits functions.
declare function f31(immediate f: number): void;
~~~~~~~~~~~~~~~~~~~
!!! error TS2874: An 'immediate' parameter must have a type that permits functions.
declare function f32(immediate ...funcs: number[]): void;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2874: An 'immediate' parameter must have a type that permits functions.
type T10 = (immediate f: () => void) => void;
type T11 = (immediate f: { (): void }) => void;
type T12 = (immediate f: Function) => void;
type T13 = (immediate f: any) => void;
type T20 = (immediate f: { foo(): void }) => void;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2874: An 'immediate' parameter must have a type that permits functions.
type T21 = (immediate f: number) => void;
~~~~~~~~~~~~~~~~~~~
!!! error TS2874: An 'immediate' parameter must have a type that permits functions.
type T22 = (immediate ...funcs: number[]) => void;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2874: An 'immediate' parameter must have a type that permits functions.
type T23 = { immediate x: () => void };
~~~~~~~~~
!!! error TS1070: 'immediate' modifier cannot appear on a type member.
// immediate modifier is not captured in argument list tuples
declare function doStuff(immediate f: () => void): void;
declare function recreate<A extends unknown[], R>(f: (...args: A) => R): (...args: A) => R;
declare function recreateImmediate1<A extends unknown[], R>(f: (immediate ...args: A) => R): (...args: A) => R;
declare function recreateImmediate2<A extends unknown[], R>(f: (...args: A) => R): (immediate ...args: A) => R;
function ff1() {
let x: string | number;
x = 123;
doStuff(() => {
x = "hi";
});
x; // string | number
}
function ff2() {
let y: string | number;
y = 123;
recreate(doStuff)(() => {
y = "hi";
});
y; // number
}
function ff3() {
let z: string | number;
z = 123;
recreateImmediate1(doStuff)(() => {
z = "hi";
});
z; // number
}
function ff4() {
let z: string | number;
z = 123;
recreateImmediate2(doStuff)(() => {
z = "hi";
});
z; // string | number
}
// https://github.com/microsoft/TypeScript/issues/11498
declare function mystery(immediate cb: () => void): void;
function fx1() {
let x: string | number = "OK";
x; // string
mystery(() => {
x = 10;
});
x; // string | number
if (x === 10) {}
}
// https://github.com/microsoft/TypeScript/issues/15380
class Foo {
public bar: string = "";
}
function fx2() {
let foo: Foo | null = null;
[1].forEach((item) => {
foo = new Foo();
});
if (foo) {
foo.bar;
}
}
// https://github.com/microsoft/TypeScript/issues/57880
const call = (immediate f: () => void) => f();
const fx3 = () => {
let a: undefined | number = undefined;
call(() => { a = 1; });
if (a !== undefined) {
a.toString();
}
};
// https://github.com/microsoft/TypeScript/issues/58291
async function execute(immediate onError: (_err: Error | undefined) => void) {
onError(new Error("a"));
}
async function run() {
let result: boolean = true;
await execute(() => {
result = false;
});
if (result === false) {
console.log("error");
}
return result;
}

View File

@@ -0,0 +1,625 @@
//// [tests/cases/compiler/immediateCallbacks.ts] ////
=== immediateCallbacks.ts ===
declare function deferred(cb: () => void): void;
>deferred : Symbol(deferred, Decl(immediateCallbacks.ts, 0, 0))
>cb : Symbol(cb, Decl(immediateCallbacks.ts, 0, 26))
declare function immediate1(immediate cb: () => void): void;
>immediate1 : Symbol(immediate1, Decl(immediateCallbacks.ts, 0, 48))
>cb : Symbol(cb, Decl(immediateCallbacks.ts, 1, 28))
declare function immediate2(/** @immediate */ cb: () => void): void;
>immediate2 : Symbol(immediate2, Decl(immediateCallbacks.ts, 1, 60))
>cb : Symbol(cb, Decl(immediateCallbacks.ts, 2, 28))
declare function immediate3(/** @immediate */ immediate cb: () => void): void;
>immediate3 : Symbol(immediate3, Decl(immediateCallbacks.ts, 2, 68))
>cb : Symbol(cb, Decl(immediateCallbacks.ts, 3, 28))
function f01() {
>f01 : Symbol(f01, Decl(immediateCallbacks.ts, 3, 78))
let x: string | number = "OK";
>x : Symbol(x, Decl(immediateCallbacks.ts, 6, 7))
deferred(() => {
>deferred : Symbol(deferred, Decl(immediateCallbacks.ts, 0, 0))
x = 42;
>x : Symbol(x, Decl(immediateCallbacks.ts, 6, 7))
});
x; // string
>x : Symbol(x, Decl(immediateCallbacks.ts, 6, 7))
}
function f02() {
>f02 : Symbol(f02, Decl(immediateCallbacks.ts, 11, 1))
let x: string | number = "OK";
>x : Symbol(x, Decl(immediateCallbacks.ts, 14, 7))
immediate1(() => {
>immediate1 : Symbol(immediate1, Decl(immediateCallbacks.ts, 0, 48))
x = 42;
>x : Symbol(x, Decl(immediateCallbacks.ts, 14, 7))
});
x; // string | number
>x : Symbol(x, Decl(immediateCallbacks.ts, 14, 7))
}
function f03() {
>f03 : Symbol(f03, Decl(immediateCallbacks.ts, 19, 1))
let x: string | number = "OK";
>x : Symbol(x, Decl(immediateCallbacks.ts, 22, 7))
immediate2(() => {
>immediate2 : Symbol(immediate2, Decl(immediateCallbacks.ts, 1, 60))
x = 42;
>x : Symbol(x, Decl(immediateCallbacks.ts, 22, 7))
});
x; // string | number
>x : Symbol(x, Decl(immediateCallbacks.ts, 22, 7))
}
function f04() {
>f04 : Symbol(f04, Decl(immediateCallbacks.ts, 27, 1))
let x: string | number = "OK";
>x : Symbol(x, Decl(immediateCallbacks.ts, 30, 7))
immediate3(() => {
>immediate3 : Symbol(immediate3, Decl(immediateCallbacks.ts, 2, 68))
x = 42;
>x : Symbol(x, Decl(immediateCallbacks.ts, 30, 7))
});
x; // string | number
>x : Symbol(x, Decl(immediateCallbacks.ts, 30, 7))
}
// Parameter is considered immediate if one or more overloads include the modifier in that parameter position
declare function overloaded<T>(cb: (x: T) => T): void;
>overloaded : Symbol(overloaded, Decl(immediateCallbacks.ts, 35, 1), Decl(immediateCallbacks.ts, 39, 54), Decl(immediateCallbacks.ts, 40, 60))
>T : Symbol(T, Decl(immediateCallbacks.ts, 39, 28))
>cb : Symbol(cb, Decl(immediateCallbacks.ts, 39, 31))
>x : Symbol(x, Decl(immediateCallbacks.ts, 39, 36))
>T : Symbol(T, Decl(immediateCallbacks.ts, 39, 28))
>T : Symbol(T, Decl(immediateCallbacks.ts, 39, 28))
declare function overloaded<T>(cb: (x: T, y: T) => T): void;
>overloaded : Symbol(overloaded, Decl(immediateCallbacks.ts, 35, 1), Decl(immediateCallbacks.ts, 39, 54), Decl(immediateCallbacks.ts, 40, 60))
>T : Symbol(T, Decl(immediateCallbacks.ts, 40, 28))
>cb : Symbol(cb, Decl(immediateCallbacks.ts, 40, 31))
>x : Symbol(x, Decl(immediateCallbacks.ts, 40, 36))
>T : Symbol(T, Decl(immediateCallbacks.ts, 40, 28))
>y : Symbol(y, Decl(immediateCallbacks.ts, 40, 41))
>T : Symbol(T, Decl(immediateCallbacks.ts, 40, 28))
>T : Symbol(T, Decl(immediateCallbacks.ts, 40, 28))
declare function overloaded(immediate cb: (...args: any) => any): void;
>overloaded : Symbol(overloaded, Decl(immediateCallbacks.ts, 35, 1), Decl(immediateCallbacks.ts, 39, 54), Decl(immediateCallbacks.ts, 40, 60))
>cb : Symbol(cb, Decl(immediateCallbacks.ts, 41, 28))
>args : Symbol(args, Decl(immediateCallbacks.ts, 41, 43))
function f05() {
>f05 : Symbol(f05, Decl(immediateCallbacks.ts, 41, 71))
let x: string | number = "OK";
>x : Symbol(x, Decl(immediateCallbacks.ts, 44, 7))
overloaded(() => {
>overloaded : Symbol(overloaded, Decl(immediateCallbacks.ts, 35, 1), Decl(immediateCallbacks.ts, 39, 54), Decl(immediateCallbacks.ts, 40, 60))
x = 42;
>x : Symbol(x, Decl(immediateCallbacks.ts, 44, 7))
});
x; // string | number
>x : Symbol(x, Decl(immediateCallbacks.ts, 44, 7))
}
// immediate is permitted on a rest parameter
declare function invokeDeferred(...args: ((...args: any) => any)[]): void;
>invokeDeferred : Symbol(invokeDeferred, Decl(immediateCallbacks.ts, 49, 1))
>args : Symbol(args, Decl(immediateCallbacks.ts, 53, 32))
>args : Symbol(args, Decl(immediateCallbacks.ts, 53, 43))
declare function invokeImmediate(immediate ...args: ((...args: any) => any)[]): void;
>invokeImmediate : Symbol(invokeImmediate, Decl(immediateCallbacks.ts, 53, 74))
>args : Symbol(args, Decl(immediateCallbacks.ts, 54, 33))
>args : Symbol(args, Decl(immediateCallbacks.ts, 54, 54))
function f06() {
>f06 : Symbol(f06, Decl(immediateCallbacks.ts, 54, 85))
let a = [];
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
a.push("abc");
>a.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
a; // string[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
invokeImmediate(
>invokeImmediate : Symbol(invokeImmediate, Decl(immediateCallbacks.ts, 53, 74))
() => {
a; // string[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
a.push(42);
>a.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
a; // (string | number)[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
},
() => {
a; // string[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
a.push(true);
>a.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
a; // (string | boolean)[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
}
);
a; // (string | number | boolean)[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 57, 7))
}
function f07() {
>f07 : Symbol(f07, Decl(immediateCallbacks.ts, 73, 1))
let a = [];
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
a.push("abc");
>a.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
a; // string[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
invokeDeferred(
>invokeDeferred : Symbol(invokeDeferred, Decl(immediateCallbacks.ts, 49, 1))
() => {
a; // string[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
a.push(42);
>a.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
a; // (string | number)[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
},
() => {
a; // string[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
a.push(true);
>a.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
a; // (string | boolean)[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
}
);
a; // string[]
>a : Symbol(a, Decl(immediateCallbacks.ts, 76, 7))
}
// immediate modifier must precede public/private/protected/readonly
class CC {
>CC : Symbol(CC, Decl(immediateCallbacks.ts, 92, 1))
constructor(immediate public readonly x: () => void) {}
>x : Symbol(CC.x, Decl(immediateCallbacks.ts, 97, 16))
}
// immediate requires parameter to have type that permits functions
declare function f10(immediate f: () => void): void;
>f10 : Symbol(f10, Decl(immediateCallbacks.ts, 98, 1))
>f : Symbol(f, Decl(immediateCallbacks.ts, 102, 21))
declare function f11(immediate f: Function): void;
>f11 : Symbol(f11, Decl(immediateCallbacks.ts, 102, 52))
>f : Symbol(f, Decl(immediateCallbacks.ts, 103, 21))
>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.decorators.d.ts, --, --))
declare function f12(immediate f: any): void;
>f12 : Symbol(f12, Decl(immediateCallbacks.ts, 103, 50))
>f : Symbol(f, Decl(immediateCallbacks.ts, 104, 21))
declare function f13(immediate f: object): void;
>f13 : Symbol(f13, Decl(immediateCallbacks.ts, 104, 45))
>f : Symbol(f, Decl(immediateCallbacks.ts, 105, 21))
declare function f14(immediate f: {}): void;
>f14 : Symbol(f14, Decl(immediateCallbacks.ts, 105, 48))
>f : Symbol(f, Decl(immediateCallbacks.ts, 106, 21))
declare function f15(immediate f: unknown): void;
>f15 : Symbol(f15, Decl(immediateCallbacks.ts, 106, 44))
>f : Symbol(f, Decl(immediateCallbacks.ts, 107, 21))
declare function f16<T extends Function>(immediate f: T): void;
>f16 : Symbol(f16, Decl(immediateCallbacks.ts, 107, 49))
>T : Symbol(T, Decl(immediateCallbacks.ts, 108, 21))
>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.decorators.d.ts, --, --))
>f : Symbol(f, Decl(immediateCallbacks.ts, 108, 41))
>T : Symbol(T, Decl(immediateCallbacks.ts, 108, 21))
declare function f17<T extends (...args: any) => any>(immediate f: T): void;
>f17 : Symbol(f17, Decl(immediateCallbacks.ts, 108, 63))
>T : Symbol(T, Decl(immediateCallbacks.ts, 109, 21))
>args : Symbol(args, Decl(immediateCallbacks.ts, 109, 32))
>f : Symbol(f, Decl(immediateCallbacks.ts, 109, 54))
>T : Symbol(T, Decl(immediateCallbacks.ts, 109, 21))
declare function f18<T extends string | (() => void)>(immediate f: T): void;
>f18 : Symbol(f18, Decl(immediateCallbacks.ts, 109, 76))
>T : Symbol(T, Decl(immediateCallbacks.ts, 110, 21))
>f : Symbol(f, Decl(immediateCallbacks.ts, 110, 54))
>T : Symbol(T, Decl(immediateCallbacks.ts, 110, 21))
declare function f20(immediate ...funcs: Function[]): void;
>f20 : Symbol(f20, Decl(immediateCallbacks.ts, 110, 76))
>funcs : Symbol(funcs, Decl(immediateCallbacks.ts, 112, 21))
>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.decorators.d.ts, --, --))
declare function f21<T extends ((...args: any) => any)[]>(immediate ...funcs: T): void;
>f21 : Symbol(f21, Decl(immediateCallbacks.ts, 112, 59))
>T : Symbol(T, Decl(immediateCallbacks.ts, 113, 21))
>args : Symbol(args, Decl(immediateCallbacks.ts, 113, 33))
>funcs : Symbol(funcs, Decl(immediateCallbacks.ts, 113, 58))
>T : Symbol(T, Decl(immediateCallbacks.ts, 113, 21))
declare function f22<T extends (string | (() => void))[]>(immediate ...funcs: T): void;
>f22 : Symbol(f22, Decl(immediateCallbacks.ts, 113, 87))
>T : Symbol(T, Decl(immediateCallbacks.ts, 114, 21))
>funcs : Symbol(funcs, Decl(immediateCallbacks.ts, 114, 58))
>T : Symbol(T, Decl(immediateCallbacks.ts, 114, 21))
declare function f23<T extends string[] | (() => void)[]>(immediate ...funcs: T): void;
>f23 : Symbol(f23, Decl(immediateCallbacks.ts, 114, 87))
>T : Symbol(T, Decl(immediateCallbacks.ts, 115, 21))
>funcs : Symbol(funcs, Decl(immediateCallbacks.ts, 115, 58))
>T : Symbol(T, Decl(immediateCallbacks.ts, 115, 21))
declare function f24<T extends (() => void)[]>(immediate ...funcs: T | string[]): void;
>f24 : Symbol(f24, Decl(immediateCallbacks.ts, 115, 87))
>T : Symbol(T, Decl(immediateCallbacks.ts, 116, 21))
>funcs : Symbol(funcs, Decl(immediateCallbacks.ts, 116, 47))
>T : Symbol(T, Decl(immediateCallbacks.ts, 116, 21))
declare function f30(immediate f: { foo(): void }): void;
>f30 : Symbol(f30, Decl(immediateCallbacks.ts, 116, 87))
>f : Symbol(f, Decl(immediateCallbacks.ts, 118, 21))
>foo : Symbol(foo, Decl(immediateCallbacks.ts, 118, 35))
declare function f31(immediate f: number): void;
>f31 : Symbol(f31, Decl(immediateCallbacks.ts, 118, 57))
>f : Symbol(f, Decl(immediateCallbacks.ts, 119, 21))
declare function f32(immediate ...funcs: number[]): void;
>f32 : Symbol(f32, Decl(immediateCallbacks.ts, 119, 48))
>funcs : Symbol(funcs, Decl(immediateCallbacks.ts, 120, 21))
type T10 = (immediate f: () => void) => void;
>T10 : Symbol(T10, Decl(immediateCallbacks.ts, 120, 57))
>f : Symbol(f, Decl(immediateCallbacks.ts, 122, 12))
type T11 = (immediate f: { (): void }) => void;
>T11 : Symbol(T11, Decl(immediateCallbacks.ts, 122, 45))
>f : Symbol(f, Decl(immediateCallbacks.ts, 123, 12))
type T12 = (immediate f: Function) => void;
>T12 : Symbol(T12, Decl(immediateCallbacks.ts, 123, 47))
>f : Symbol(f, Decl(immediateCallbacks.ts, 124, 12))
>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.decorators.d.ts, --, --))
type T13 = (immediate f: any) => void;
>T13 : Symbol(T13, Decl(immediateCallbacks.ts, 124, 43))
>f : Symbol(f, Decl(immediateCallbacks.ts, 125, 12))
type T20 = (immediate f: { foo(): void }) => void;
>T20 : Symbol(T20, Decl(immediateCallbacks.ts, 125, 38))
>f : Symbol(f, Decl(immediateCallbacks.ts, 127, 12))
>foo : Symbol(foo, Decl(immediateCallbacks.ts, 127, 26))
type T21 = (immediate f: number) => void;
>T21 : Symbol(T21, Decl(immediateCallbacks.ts, 127, 50))
>f : Symbol(f, Decl(immediateCallbacks.ts, 128, 12))
type T22 = (immediate ...funcs: number[]) => void;
>T22 : Symbol(T22, Decl(immediateCallbacks.ts, 128, 41))
>funcs : Symbol(funcs, Decl(immediateCallbacks.ts, 129, 12))
type T23 = { immediate x: () => void };
>T23 : Symbol(T23, Decl(immediateCallbacks.ts, 129, 50))
>x : Symbol(x, Decl(immediateCallbacks.ts, 130, 12))
// immediate modifier is not captured in argument list tuples
declare function doStuff(immediate f: () => void): void;
>doStuff : Symbol(doStuff, Decl(immediateCallbacks.ts, 130, 39))
>f : Symbol(f, Decl(immediateCallbacks.ts, 134, 25))
declare function recreate<A extends unknown[], R>(f: (...args: A) => R): (...args: A) => R;
>recreate : Symbol(recreate, Decl(immediateCallbacks.ts, 134, 56))
>A : Symbol(A, Decl(immediateCallbacks.ts, 136, 26))
>R : Symbol(R, Decl(immediateCallbacks.ts, 136, 46))
>f : Symbol(f, Decl(immediateCallbacks.ts, 136, 50))
>args : Symbol(args, Decl(immediateCallbacks.ts, 136, 54))
>A : Symbol(A, Decl(immediateCallbacks.ts, 136, 26))
>R : Symbol(R, Decl(immediateCallbacks.ts, 136, 46))
>args : Symbol(args, Decl(immediateCallbacks.ts, 136, 74))
>A : Symbol(A, Decl(immediateCallbacks.ts, 136, 26))
>R : Symbol(R, Decl(immediateCallbacks.ts, 136, 46))
declare function recreateImmediate1<A extends unknown[], R>(f: (immediate ...args: A) => R): (...args: A) => R;
>recreateImmediate1 : Symbol(recreateImmediate1, Decl(immediateCallbacks.ts, 136, 91))
>A : Symbol(A, Decl(immediateCallbacks.ts, 137, 36))
>R : Symbol(R, Decl(immediateCallbacks.ts, 137, 56))
>f : Symbol(f, Decl(immediateCallbacks.ts, 137, 60))
>args : Symbol(args, Decl(immediateCallbacks.ts, 137, 64))
>A : Symbol(A, Decl(immediateCallbacks.ts, 137, 36))
>R : Symbol(R, Decl(immediateCallbacks.ts, 137, 56))
>args : Symbol(args, Decl(immediateCallbacks.ts, 137, 94))
>A : Symbol(A, Decl(immediateCallbacks.ts, 137, 36))
>R : Symbol(R, Decl(immediateCallbacks.ts, 137, 56))
declare function recreateImmediate2<A extends unknown[], R>(f: (...args: A) => R): (immediate ...args: A) => R;
>recreateImmediate2 : Symbol(recreateImmediate2, Decl(immediateCallbacks.ts, 137, 111))
>A : Symbol(A, Decl(immediateCallbacks.ts, 138, 36))
>R : Symbol(R, Decl(immediateCallbacks.ts, 138, 56))
>f : Symbol(f, Decl(immediateCallbacks.ts, 138, 60))
>args : Symbol(args, Decl(immediateCallbacks.ts, 138, 64))
>A : Symbol(A, Decl(immediateCallbacks.ts, 138, 36))
>R : Symbol(R, Decl(immediateCallbacks.ts, 138, 56))
>args : Symbol(args, Decl(immediateCallbacks.ts, 138, 84))
>A : Symbol(A, Decl(immediateCallbacks.ts, 138, 36))
>R : Symbol(R, Decl(immediateCallbacks.ts, 138, 56))
function ff1() {
>ff1 : Symbol(ff1, Decl(immediateCallbacks.ts, 138, 111))
let x: string | number;
>x : Symbol(x, Decl(immediateCallbacks.ts, 141, 7))
x = 123;
>x : Symbol(x, Decl(immediateCallbacks.ts, 141, 7))
doStuff(() => {
>doStuff : Symbol(doStuff, Decl(immediateCallbacks.ts, 130, 39))
x = "hi";
>x : Symbol(x, Decl(immediateCallbacks.ts, 141, 7))
});
x; // string | number
>x : Symbol(x, Decl(immediateCallbacks.ts, 141, 7))
}
function ff2() {
>ff2 : Symbol(ff2, Decl(immediateCallbacks.ts, 147, 1))
let y: string | number;
>y : Symbol(y, Decl(immediateCallbacks.ts, 150, 7))
y = 123;
>y : Symbol(y, Decl(immediateCallbacks.ts, 150, 7))
recreate(doStuff)(() => {
>recreate : Symbol(recreate, Decl(immediateCallbacks.ts, 134, 56))
>doStuff : Symbol(doStuff, Decl(immediateCallbacks.ts, 130, 39))
y = "hi";
>y : Symbol(y, Decl(immediateCallbacks.ts, 150, 7))
});
y; // number
>y : Symbol(y, Decl(immediateCallbacks.ts, 150, 7))
}
function ff3() {
>ff3 : Symbol(ff3, Decl(immediateCallbacks.ts, 156, 1))
let z: string | number;
>z : Symbol(z, Decl(immediateCallbacks.ts, 159, 7))
z = 123;
>z : Symbol(z, Decl(immediateCallbacks.ts, 159, 7))
recreateImmediate1(doStuff)(() => {
>recreateImmediate1 : Symbol(recreateImmediate1, Decl(immediateCallbacks.ts, 136, 91))
>doStuff : Symbol(doStuff, Decl(immediateCallbacks.ts, 130, 39))
z = "hi";
>z : Symbol(z, Decl(immediateCallbacks.ts, 159, 7))
});
z; // number
>z : Symbol(z, Decl(immediateCallbacks.ts, 159, 7))
}
function ff4() {
>ff4 : Symbol(ff4, Decl(immediateCallbacks.ts, 165, 1))
let z: string | number;
>z : Symbol(z, Decl(immediateCallbacks.ts, 168, 7))
z = 123;
>z : Symbol(z, Decl(immediateCallbacks.ts, 168, 7))
recreateImmediate2(doStuff)(() => {
>recreateImmediate2 : Symbol(recreateImmediate2, Decl(immediateCallbacks.ts, 137, 111))
>doStuff : Symbol(doStuff, Decl(immediateCallbacks.ts, 130, 39))
z = "hi";
>z : Symbol(z, Decl(immediateCallbacks.ts, 168, 7))
});
z; // string | number
>z : Symbol(z, Decl(immediateCallbacks.ts, 168, 7))
}
// https://github.com/microsoft/TypeScript/issues/11498
declare function mystery(immediate cb: () => void): void;
>mystery : Symbol(mystery, Decl(immediateCallbacks.ts, 174, 1))
>cb : Symbol(cb, Decl(immediateCallbacks.ts, 178, 25))
function fx1() {
>fx1 : Symbol(fx1, Decl(immediateCallbacks.ts, 178, 57))
let x: string | number = "OK";
>x : Symbol(x, Decl(immediateCallbacks.ts, 181, 7))
x; // string
>x : Symbol(x, Decl(immediateCallbacks.ts, 181, 7))
mystery(() => {
>mystery : Symbol(mystery, Decl(immediateCallbacks.ts, 174, 1))
x = 10;
>x : Symbol(x, Decl(immediateCallbacks.ts, 181, 7))
});
x; // string | number
>x : Symbol(x, Decl(immediateCallbacks.ts, 181, 7))
if (x === 10) {}
>x : Symbol(x, Decl(immediateCallbacks.ts, 181, 7))
}
// https://github.com/microsoft/TypeScript/issues/15380
class Foo {
>Foo : Symbol(Foo, Decl(immediateCallbacks.ts, 188, 1))
public bar: string = "";
>bar : Symbol(Foo.bar, Decl(immediateCallbacks.ts, 192, 11))
}
function fx2() {
>fx2 : Symbol(fx2, Decl(immediateCallbacks.ts, 194, 1))
let foo: Foo | null = null;
>foo : Symbol(foo, Decl(immediateCallbacks.ts, 197, 5))
>Foo : Symbol(Foo, Decl(immediateCallbacks.ts, 188, 1))
[1].forEach((item) => {
>[1].forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
>item : Symbol(item, Decl(immediateCallbacks.ts, 198, 15))
foo = new Foo();
>foo : Symbol(foo, Decl(immediateCallbacks.ts, 197, 5))
>Foo : Symbol(Foo, Decl(immediateCallbacks.ts, 188, 1))
});
if (foo) {
>foo : Symbol(foo, Decl(immediateCallbacks.ts, 197, 5))
foo.bar;
>foo.bar : Symbol(Foo.bar, Decl(immediateCallbacks.ts, 192, 11))
>foo : Symbol(foo, Decl(immediateCallbacks.ts, 197, 5))
>bar : Symbol(Foo.bar, Decl(immediateCallbacks.ts, 192, 11))
}
}
// https://github.com/microsoft/TypeScript/issues/57880
const call = (immediate f: () => void) => f();
>call : Symbol(call, Decl(immediateCallbacks.ts, 208, 5))
>f : Symbol(f, Decl(immediateCallbacks.ts, 208, 14))
>f : Symbol(f, Decl(immediateCallbacks.ts, 208, 14))
const fx3 = () => {
>fx3 : Symbol(fx3, Decl(immediateCallbacks.ts, 210, 5))
let a: undefined | number = undefined;
>a : Symbol(a, Decl(immediateCallbacks.ts, 211, 7))
>undefined : Symbol(undefined)
call(() => { a = 1; });
>call : Symbol(call, Decl(immediateCallbacks.ts, 208, 5))
>a : Symbol(a, Decl(immediateCallbacks.ts, 211, 7))
if (a !== undefined) {
>a : Symbol(a, Decl(immediateCallbacks.ts, 211, 7))
>undefined : Symbol(undefined)
a.toString();
>a.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
>a : Symbol(a, Decl(immediateCallbacks.ts, 211, 7))
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
}
};
// https://github.com/microsoft/TypeScript/issues/58291
async function execute(immediate onError: (_err: Error | undefined) => void) {
>execute : Symbol(execute, Decl(immediateCallbacks.ts, 216, 2))
>onError : Symbol(onError, Decl(immediateCallbacks.ts, 220, 23))
>_err : Symbol(_err, Decl(immediateCallbacks.ts, 220, 43))
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --))
onError(new Error("a"));
>onError : Symbol(onError, Decl(immediateCallbacks.ts, 220, 23))
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --))
}
async function run() {
>run : Symbol(run, Decl(immediateCallbacks.ts, 222, 1))
let result: boolean = true;
>result : Symbol(result, Decl(immediateCallbacks.ts, 225, 7))
await execute(() => {
>execute : Symbol(execute, Decl(immediateCallbacks.ts, 216, 2))
result = false;
>result : Symbol(result, Decl(immediateCallbacks.ts, 225, 7))
});
if (result === false) {
>result : Symbol(result, Decl(immediateCallbacks.ts, 225, 7))
console.log("error");
>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
>console : Symbol(console, Decl(lib.dom.d.ts, --, --))
>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
}
return result;
>result : Symbol(result, Decl(immediateCallbacks.ts, 225, 7))
}

File diff suppressed because it is too large Load Diff

View File

@@ -1838,8 +1838,8 @@ module Harness {
});
return isAsync;
>isAsync : boolean
> : ^^^^^^^
>isAsync : true
> : ^^^^
}
} catch (e) {

View File

@@ -2328,8 +2328,8 @@ module Formatting {
});
return result;
>result : boolean
> : ^^^^^^^
>result : true
> : ^^^^
}
return false;