Skip to content

Commit 476e9ee

Browse files
Extract node type printer (#59282)
1 parent 2c23bea commit 476e9ee

File tree

96 files changed

+1984
-1504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1984
-1504
lines changed

src/compiler/checker.ts

+380-809
Large diffs are not rendered by default.

src/compiler/diagnosticMessages.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6998,7 +6998,7 @@
69986998
"category": "Error",
69996999
"code": 9008
70007000
},
7001-
"At least one accessor must have an explicit return type annotation with --isolatedDeclarations.": {
7001+
"At least one accessor must have an explicit type annotation with --isolatedDeclarations.": {
70027002
"category": "Error",
70037003
"code": 9009
70047004
},

src/compiler/expressionToTypeNode.ts

+982-154
Large diffs are not rendered by default.

src/compiler/factory/utilities.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ export function createAccessorPropertySetRedirector(factory: NodeFactory, node:
16681668
}
16691669

16701670
/** @internal */
1671-
export function findComputedPropertyNameCacheAssignment(name: ComputedPropertyName) {
1671+
export function findComputedPropertyNameCacheAssignment(name: ComputedPropertyName): AssignmentExpression<EqualsToken> & { readonly left: GeneratedIdentifier; } | undefined {
16721672
let node = name.expression;
16731673
while (true) {
16741674
node = skipOuterExpressions(node);

src/compiler/transformers/declarations.ts

+43-83
Large diffs are not rendered by default.

src/compiler/transformers/declarations/diagnostics.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ export function createGetIsolatedDeclarationErrors(resolver: EmitResolver): (nod
625625
[SyntaxKind.ArrowFunction]: Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
626626
[SyntaxKind.MethodDeclaration]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
627627
[SyntaxKind.ConstructSignature]: Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
628-
[SyntaxKind.GetAccessor]: Diagnostics.At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
629-
[SyntaxKind.SetAccessor]: Diagnostics.At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations,
628+
[SyntaxKind.GetAccessor]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
629+
[SyntaxKind.SetAccessor]: Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
630630
[SyntaxKind.Parameter]: Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
631631
[SyntaxKind.VariableDeclaration]: Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
632632
[SyntaxKind.PropertyDeclaration]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,

src/compiler/types.ts

+43-14
Original file line numberDiff line numberDiff line change
@@ -5849,7 +5849,7 @@ export interface EmitResolver {
58495849
requiresAddingImplicitUndefined(node: ParameterDeclaration, enclosingDeclaration: Node | undefined): boolean;
58505850
isExpandoFunctionDeclaration(node: FunctionDeclaration | VariableDeclaration): boolean;
58515851
getPropertiesOfContainerFunction(node: Declaration): Symbol[];
5852-
createTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration | PropertyAccessExpression | ElementAccessExpression | BinaryExpression, enclosingDeclaration: Node, flags: NodeBuilderFlags, internalFlags: InternalNodeBuilderFlags, tracker: SymbolTracker): TypeNode | undefined;
5852+
createTypeOfDeclaration(declaration: HasInferredType, enclosingDeclaration: Node, flags: NodeBuilderFlags, internalFlags: InternalNodeBuilderFlags, tracker: SymbolTracker): TypeNode | undefined;
58535853
createReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: NodeBuilderFlags, internalFlags: InternalNodeBuilderFlags, tracker: SymbolTracker): TypeNode | undefined;
58545854
createTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: NodeBuilderFlags, internalFlags: InternalNodeBuilderFlags, tracker: SymbolTracker): TypeNode | undefined;
58555855
createLiteralConstValue(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration, tracker: SymbolTracker): Expression;
@@ -10504,37 +10504,66 @@ export interface EvaluationResolver {
1050410504

1050510505
/** @internal */
1050610506
export type HasInferredType =
10507-
| PropertyAssignment
10507+
| Exclude<VariableLikeDeclaration, JsxAttribute | EnumMember>
1050810508
| PropertyAccessExpression
10509-
| BinaryExpression
1051010509
| ElementAccessExpression
10511-
| VariableDeclaration
10512-
| ParameterDeclaration
10513-
| BindingElement
10514-
| PropertyDeclaration
10515-
| PropertySignature
10510+
| BinaryExpression
1051610511
| ExportAssignment;
1051710512

1051810513
/** @internal */
1051910514
export interface SyntacticTypeNodeBuilderContext {
10515+
flags: NodeBuilderFlags;
1052010516
tracker: Required<Pick<SymbolTracker, "reportInferenceFallback">>;
10517+
enclosingFile: SourceFile | undefined;
1052110518
enclosingDeclaration: Node | undefined;
10519+
approximateLength: number;
10520+
noInferenceFallback?: boolean;
10521+
suppressReportInferenceFallback: boolean;
1052210522
}
1052310523

1052410524
/** @internal */
1052510525
export interface SyntacticTypeNodeBuilderResolver {
10526+
isOptionalParameter(p: ParameterDeclaration): boolean;
1052610527
isUndefinedIdentifierExpression(name: Identifier): boolean;
1052710528
isExpandoFunctionDeclaration(name: FunctionDeclaration | VariableDeclaration): boolean;
1052810529
getAllAccessorDeclarations(declaration: AccessorDeclaration): AllAccessorDeclarations;
10529-
isEntityNameVisible(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node, shouldComputeAliasToMakeVisible?: boolean): SymbolVisibilityResult;
10530-
requiresAddingImplicitUndefined(parameter: ParameterDeclaration | JSDocParameterTag, enclosingDeclaration: Node | undefined): boolean;
10530+
requiresAddingImplicitUndefined(declaration: ParameterDeclaration | PropertySignature | JSDocParameterTag | JSDocPropertyTag | PropertyDeclaration, symbol: Symbol | undefined, enclosingDeclaration: Node | undefined): boolean;
1053110531
isDefinitelyReferenceToGlobalSymbolObject(node: Node): boolean;
10532+
isEntityNameVisible(context: SyntacticTypeNodeBuilderContext, entityName: EntityNameOrEntityNameExpression, shouldComputeAliasToMakeVisible?: boolean): SymbolVisibilityResult;
10533+
serializeExistingTypeNode(context: SyntacticTypeNodeBuilderContext, node: TypeNode, addUndefined?: boolean): TypeNode | undefined;
10534+
serializeReturnTypeForSignature(context: SyntacticTypeNodeBuilderContext, signatureDeclaration: SignatureDeclaration | JSDocSignature): TypeNode | undefined;
10535+
serializeTypeOfExpression(context: SyntacticTypeNodeBuilderContext, expr: Expression): TypeNode;
10536+
serializeTypeOfDeclaration(context: SyntacticTypeNodeBuilderContext, node: HasInferredType | GetAccessorDeclaration | SetAccessorDeclaration, symbol: Symbol | undefined): TypeNode | undefined;
10537+
serializeNameOfParameter(context: SyntacticTypeNodeBuilderContext, parameter: ParameterDeclaration): BindingName | string;
10538+
serializeTypeName(context: SyntacticTypeNodeBuilderContext, node: EntityName, isTypeOf?: boolean, typeArguments?: readonly TypeNode[]): TypeNode | undefined;
10539+
serializeEntityName(context: SyntacticTypeNodeBuilderContext, node: EntityNameExpression): Expression | undefined;
10540+
getJsDocPropertyOverride(context: SyntacticTypeNodeBuilderContext, jsDocTypeLiteral: JSDocTypeLiteral, jsDocProperty: JSDocPropertyLikeTag): TypeNode | undefined;
10541+
enterNewScope(context: SyntacticTypeNodeBuilderContext, node: IntroducesNewScopeNode | ConditionalTypeNode): () => void;
10542+
markNodeReuse<T extends Node>(context: SyntacticTypeNodeBuilderContext, range: T, location: Node | undefined): T;
10543+
trackExistingEntityName<T extends EntityNameOrEntityNameExpression>(context: SyntacticTypeNodeBuilderContext, node: T): { introducesError: boolean; node: T; };
10544+
trackComputedName(context: SyntacticTypeNodeBuilderContext, accessExpression: EntityNameOrEntityNameExpression): void;
10545+
evaluateEntityNameExpression(expression: EntityNameExpression): EvaluatorResult;
10546+
getModuleSpecifierOverride(context: SyntacticTypeNodeBuilderContext, parent: ImportTypeNode, lit: StringLiteral): string | undefined;
10547+
canReuseTypeNode(context: SyntacticTypeNodeBuilderContext, existing: TypeNode): boolean;
10548+
canReuseTypeNodeAnnotation(context: SyntacticTypeNodeBuilderContext, node: Declaration, existing: TypeNode, symbol: Symbol | undefined, requiresAddingUndefined?: boolean): boolean;
10549+
shouldRemoveDeclaration(context: SyntacticTypeNodeBuilderContext, node: DynamicNamedDeclaration): boolean;
10550+
hasLateBindableName(node: Declaration): node is LateBoundDeclaration | LateBoundBinaryExpressionDeclaration;
10551+
createRecoveryBoundary(context: SyntacticTypeNodeBuilderContext): {
10552+
startRecoveryScope(): () => void;
10553+
finalizeBoundary(): boolean;
10554+
markError(): void;
10555+
hadError(): boolean;
10556+
};
1053210557
}
1053310558

1053410559
/** @internal */
1053510560
export interface SyntacticNodeBuilder {
10536-
typeFromExpression: (node: Expression, context: SyntacticTypeNodeBuilderContext, isConstContext?: boolean, requiresAddingUndefined?: boolean, preserveLiterals?: boolean) => boolean | undefined;
10537-
serializeTypeOfDeclaration: (node: HasInferredType, context: SyntacticTypeNodeBuilderContext) => boolean | undefined;
10538-
serializeReturnTypeForSignature: (node: SignatureDeclaration | JSDocSignature, context: SyntacticTypeNodeBuilderContext) => boolean | undefined;
10539-
serializeTypeOfExpression: (expr: Expression, context: SyntacticTypeNodeBuilderContext, addUndefined?: boolean, preserveLiterals?: boolean) => boolean;
10561+
serializeTypeOfDeclaration: (node: HasInferredType, symbol: Symbol, context: SyntacticTypeNodeBuilderContext) => TypeNode | undefined;
10562+
serializeReturnTypeForSignature: (signature: SignatureDeclaration | JSDocSignature, symbol: Symbol, context: SyntacticTypeNodeBuilderContext) => TypeNode | undefined;
10563+
serializeTypeOfExpression: (expr: Expression | JsxAttributeValue, context: SyntacticTypeNodeBuilderContext, addUndefined?: boolean, preserveLiterals?: boolean) => TypeNode;
10564+
tryReuseExistingTypeNode: (context: SyntacticTypeNodeBuilderContext, existing: TypeNode) => TypeNode | undefined;
10565+
serializeTypeOfAccessor: (accessor: AccessorDeclaration, symbol: Symbol, context: SyntacticTypeNodeBuilderContext) => TypeNode | undefined;
1054010566
}
10567+
10568+
/** @internal */
10569+
export type IntroducesNewScopeNode = SignatureDeclaration | JSDocSignature | MappedTypeNode;

src/compiler/utilities.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ import {
246246
InterfaceDeclaration,
247247
InternalEmitFlags,
248248
InternalSymbolName,
249+
IntroducesNewScopeNode,
249250
isAccessor,
250251
isAnyDirectorySeparator,
251252
isArray,
@@ -322,6 +323,7 @@ import {
322323
isLeftHandSideExpression,
323324
isLineBreak,
324325
isLiteralTypeNode,
326+
isMappedTypeNode,
325327
isMemberName,
326328
isMetaProperty,
327329
isMethodDeclaration,
@@ -2920,11 +2922,6 @@ export function isVariableLike(node: Node): node is VariableLikeDeclaration {
29202922
return false;
29212923
}
29222924

2923-
/** @internal */
2924-
export function isVariableLikeOrAccessor(node: Node): node is AccessorDeclaration | VariableLikeDeclaration {
2925-
return isVariableLike(node) || isAccessor(node);
2926-
}
2927-
29282925
/** @internal */
29292926
export function isVariableDeclarationInVariableStatement(node: VariableDeclaration): boolean {
29302927
return node.parent.kind === SyntaxKind.VariableDeclarationList
@@ -11938,6 +11935,9 @@ export function hasInferredType(node: Node): node is HasInferredType {
1193811935
case SyntaxKind.VariableDeclaration:
1193911936
case SyntaxKind.ExportAssignment:
1194011937
case SyntaxKind.PropertyAssignment:
11938+
case SyntaxKind.ShorthandPropertyAssignment:
11939+
case SyntaxKind.JSDocParameterTag:
11940+
case SyntaxKind.JSDocPropertyTag:
1194111941
return true;
1194211942
default:
1194311943
assertType<never>(node);
@@ -12077,3 +12077,9 @@ function getNodeAtPosition(sourceFile: SourceFile, position: number, includeJSDo
1207712077
current = child;
1207812078
}
1207912079
}
12080+
/** @internal */
12081+
export function isNewScopeNode(node: Node): node is IntroducesNewScopeNode {
12082+
return isFunctionLike(node)
12083+
|| isJSDocSignature(node)
12084+
|| isMappedTypeNode(node);
12085+
}

src/services/codefixes/fixMissingTypeAnnotationOnExports.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const extractExpression = "extract-expression";
119119
const errorCodes = [
120120
Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,
121121
Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,
122-
Diagnostics.At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,
122+
Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,
123123
Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,
124124
Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,
125125
Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,

tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ var a = () => <Error>{ name: "foo", message: "bar" };
2121

2222
var b = () => (<Error>{ name: "foo", message: "bar" });
2323
>b : () => Error
24-
> : ^^^^^^^^^^^
24+
> : ^^^^^^
2525
>() => (<Error>{ name: "foo", message: "bar" }) : () => Error
26-
> : ^^^^^^^^^^^
26+
> : ^^^^^^
2727
>(<Error>{ name: "foo", message: "bar" }) : Error
2828
> : ^^^^^
2929
><Error>{ name: "foo", message: "bar" } : Error
@@ -59,9 +59,9 @@ var c = () => ({ name: "foo", message: "bar" });
5959

6060
var d = () => ((<Error>({ name: "foo", message: "bar" })));
6161
>d : () => Error
62-
> : ^^^^^^^^^^^
62+
> : ^^^^^^
6363
>() => ((<Error>({ name: "foo", message: "bar" }))) : () => Error
64-
> : ^^^^^^^^^^^
64+
> : ^^^^^^
6565
>((<Error>({ name: "foo", message: "bar" }))) : Error
6666
> : ^^^^^
6767
>(<Error>({ name: "foo", message: "bar" })) : Error

tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ var a = () => <Error>{ name: "foo", message: "bar" };
2121

2222
var b = () => (<Error>{ name: "foo", message: "bar" });
2323
>b : () => Error
24-
> : ^^^^^^^^^^^
24+
> : ^^^^^^
2525
>() => (<Error>{ name: "foo", message: "bar" }) : () => Error
26-
> : ^^^^^^^^^^^
26+
> : ^^^^^^
2727
>(<Error>{ name: "foo", message: "bar" }) : Error
2828
> : ^^^^^
2929
><Error>{ name: "foo", message: "bar" } : Error
@@ -59,9 +59,9 @@ var c = () => ({ name: "foo", message: "bar" });
5959

6060
var d = () => ((<Error>({ name: "foo", message: "bar" })));
6161
>d : () => Error
62-
> : ^^^^^^^^^^^
62+
> : ^^^^^^
6363
>() => ((<Error>({ name: "foo", message: "bar" }))) : () => Error
64-
> : ^^^^^^^^^^^
64+
> : ^^^^^^
6565
>((<Error>({ name: "foo", message: "bar" }))) : Error
6666
> : ^^^^^
6767
>(<Error>({ name: "foo", message: "bar" })) : Error

tests/baselines/reference/circularAccessorAnnotations.types

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
=== circularAccessorAnnotations.ts ===
44
declare const c1: {
5-
>c1 : { readonly foo: any; }
6-
> : ^^^^^^^^^^^^^^^^^^^^^^
5+
>c1 : { readonly foo: typeof c1.foo; }
6+
> : ^^^^^^^^^^^^^^^^ ^^^
77

88
get foo(): typeof c1.foo;
99
>foo : any
1010
> : ^^^
1111
>c1.foo : any
1212
> : ^^^
13-
>c1 : { readonly foo: any; }
14-
> : ^^^^^^^^^^^^^^^^^^^^^^
13+
>c1 : { readonly foo: typeof c1.foo; }
14+
> : ^^^^^^^^^^^^^^^^ ^^^
1515
>foo : any
1616
> : ^^^
1717
}
1818

1919
declare const c2: {
20-
>c2 : { foo: any; }
21-
> : ^^^^^^^^^^^^^
20+
>c2 : { foo: typeof c2.foo; }
21+
> : ^^^^^^^ ^^^
2222

2323
set foo(value: typeof c2.foo);
2424
>foo : any
@@ -27,15 +27,15 @@ declare const c2: {
2727
> : ^^^
2828
>c2.foo : any
2929
> : ^^^
30-
>c2 : { foo: any; }
31-
> : ^^^^^^^^^^^^^
30+
>c2 : { foo: typeof c2.foo; }
31+
> : ^^^^^^^ ^^^
3232
>foo : any
3333
> : ^^^
3434
}
3535

3636
declare const c3: {
3737
>c3 : { foo: string; }
38-
> : ^^^^^^^^^^^^^^^^
38+
> : ^^^^^^^ ^^^
3939

4040
get foo(): string;
4141
>foo : string
@@ -49,7 +49,7 @@ declare const c3: {
4949
>c3.foo : string
5050
> : ^^^^^^
5151
>c3 : { foo: string; }
52-
> : ^^^^^^^^^^^^^^^^
52+
> : ^^^^^^^ ^^^
5353
>foo : string
5454
> : ^^^^^^
5555
}

tests/baselines/reference/circularObjectLiteralAccessors.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
const a = {
77
>a : { b: { foo: string; }; foo: string; }
8-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8+
> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
99
>{ b: { get foo(): string { return a.foo; }, set foo(value: string) { a.foo = value; } }, foo: ''} : { b: { foo: string; }; foo: string; }
10-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10+
> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
1111

1212
b: {
1313
>b : { foo: string; }
14-
> : ^^^^^^^^^^^^^^^^
14+
> : ^^^^^^^ ^^^
1515
>{ get foo(): string { return a.foo; }, set foo(value: string) { a.foo = value; } } : { foo: string; }
16-
> : ^^^^^^^^^^^^^^^^
16+
> : ^^^^^^^ ^^^
1717

1818
get foo(): string {
1919
>foo : string
@@ -23,7 +23,7 @@ const a = {
2323
>a.foo : string
2424
> : ^^^^^^
2525
>a : { b: { foo: string; }; foo: string; }
26-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26+
> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
2727
>foo : string
2828
> : ^^^^^^
2929

@@ -40,7 +40,7 @@ const a = {
4040
>a.foo : string
4141
> : ^^^^^^
4242
>a : { b: { foo: string; }; foo: string; }
43-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43+
> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
4444
>foo : string
4545
> : ^^^^^^
4646
>value : string

tests/baselines/reference/collisionArgumentsArrowFunctions.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
=== collisionArgumentsArrowFunctions.ts ===
44
var f1 = (i: number, ...arguments) => { //arguments is error
55
>f1 : (i: number, ...arguments: any[]) => void
6-
> : ^ ^^ ^^^^^ ^^ ^^^^^^^^^
6+
> : ^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^
77
>(i: number, ...arguments) => { //arguments is error var arguments: any[]; // no error} : (i: number, ...arguments: any[]) => void
8-
> : ^ ^^ ^^^^^ ^^ ^^^^^^^^^
8+
> : ^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^
99
>i : number
1010
> : ^^^^^^
1111
>arguments : any[]

tests/baselines/reference/collisionArgumentsClassMethod.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class c1 {
77

88
public foo(i: number, ...arguments) { //arguments is error
99
>foo : (i: number, ...arguments: any[]) => void
10-
> : ^ ^^ ^^^^^ ^^ ^^^^^^^^^
10+
> : ^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^
1111
>i : number
1212
> : ^^^^^^
1313
>arguments : any[]

tests/baselines/reference/collisionArgumentsFunction.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function f1(arguments: number, ...restParameters) { //arguments is error
1818
}
1919
function f12(i: number, ...arguments) { //arguments is error
2020
>f12 : (i: number, ...arguments: any[]) => void
21-
> : ^ ^^ ^^^^^ ^^ ^^^^^^^^^
21+
> : ^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^
2222
>i : number
2323
> : ^^^^^^
2424
>arguments : any[]

tests/baselines/reference/collisionArgumentsFunctionExpressions.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function foo() {
2121
}
2222
function f12(i: number, ...arguments) { //arguments is error
2323
>f12 : (i: number, ...arguments: any[]) => void
24-
> : ^ ^^ ^^^^^ ^^ ^^^^^^^^^
24+
> : ^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^
2525
>i : number
2626
> : ^^^^^^
2727
>arguments : any[]

tests/baselines/reference/commentsOnObjectLiteral4.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
=== commentsOnObjectLiteral4.ts ===
44
var v = {
55
>v : { readonly bar: number; }
6-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
6+
> : ^^^^^^^^^^^^^^^^ ^^^
77
>{ /** * @type {number} */ get bar(): number { return 12; }} : { readonly bar: number; }
8-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
8+
> : ^^^^^^^^^^^^^^^^ ^^^
99

1010
/**
1111
* @type {number}

0 commit comments

Comments
 (0)