From e2af8b1e92e39b031cf38e339af01c43e0df7557 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 17 Sep 2025 10:20:33 -0700 Subject: [PATCH 1/2] Port late bound class property declaration emit --- internal/ast/ast.go | 42 +++++++++++++++++++ internal/checker/checker.go | 35 +++++++++++----- internal/checker/emitresolver.go | 40 ++++++++++++++++-- internal/checker/inference.go | 4 +- internal/checker/types.go | 3 +- ...ssNonUniqueSymbolMethodHasSymbolIndexer.js | 3 ++ ...UniqueSymbolMethodHasSymbolIndexer.js.diff | 13 ++---- ...clarationEmitAnyComputedPropertyInClass.js | 2 + ...tionEmitAnyComputedPropertyInClass.js.diff | 9 ++-- ...rationEmitComputedNameWithQuestionToken.js | 1 + ...nEmitComputedNameWithQuestionToken.js.diff | 5 +-- ...tionEmitMultipleComputedNamesSameDomain.js | 2 + ...mitMultipleComputedNamesSameDomain.js.diff | 4 +- .../declarationEmitSimpleComputedNames1.js | 12 ++++++ ...eclarationEmitSimpleComputedNames1.js.diff | 29 +++++-------- .../isolatedDeclarationErrorsClasses.js | 5 +++ .../isolatedDeclarationErrorsClasses.js.diff | 5 +++ ...eDynamicName1(noimplicitoverride=false).js | 5 +++ ...micName1(noimplicitoverride=false).js.diff | 13 +++--- ...deDynamicName1(noimplicitoverride=true).js | 5 +++ ...amicName1(noimplicitoverride=true).js.diff | 13 +++--- ...dexSignature1(noimplicitoverride=false).js | 5 +++ ...gnature1(noimplicitoverride=false).js.diff | 13 +++--- ...ndexSignature1(noimplicitoverride=true).js | 5 +++ ...ignature1(noimplicitoverride=true).js.diff | 13 +++--- 25 files changed, 203 insertions(+), 83 deletions(-) diff --git a/internal/ast/ast.go b/internal/ast/ast.go index 7d7dea31d3..e991bd08ad 100644 --- a/internal/ast/ast.go +++ b/internal/ast/ast.go @@ -1067,6 +1067,48 @@ func (n *Node) Elements() []*Node { return nil } +func (n *Node) postfixToken() *Node { + switch n.Kind { + case KindEnumMember: + return n.AsEnumMember().PostfixToken + case KindPropertyAssignment: + return n.AsPropertyAssignment().PostfixToken + case KindShorthandPropertyAssignment: + return n.AsShorthandPropertyAssignment().PostfixToken + case KindPropertySignature: + return n.AsPropertySignatureDeclaration().PostfixToken + case KindPropertyDeclaration: + return n.AsPropertyDeclaration().PostfixToken + case KindMethodSignature: + return n.AsMethodSignatureDeclaration().PostfixToken + case KindMethodDeclaration: + return n.AsMethodDeclaration().PostfixToken + case KindGetAccessor: + return n.AsGetAccessorDeclaration().PostfixToken + case KindSetAccessor: + return n.AsSetAccessorDeclaration().PostfixToken + } + return nil +} + +func (n *Node) QuestionToken() *TokenNode { + switch n.Kind { + case KindParameter: + return n.AsParameterDeclaration().QuestionToken + case KindConditionalExpression: + return n.AsConditionalExpression().QuestionToken + case KindMappedType: + return n.AsMappedTypeNode().QuestionToken + case KindNamedTupleMember: + return n.AsNamedTupleMember().QuestionToken + } + postfix := n.postfixToken() + if postfix != nil && postfix.Kind == KindQuestionToken { + return postfix + } + return nil +} + func (n *Node) QuestionDotToken() *Node { switch n.Kind { case KindElementAccessExpression: diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 9844cbc289..1fa8c4360c 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -12907,7 +12907,7 @@ func (c *Checker) getSpreadType(left *Type, right *Type, symbol *ast.Symbol, obj func (c *Checker) getIndexInfoWithReadonly(info *IndexInfo, readonly bool) *IndexInfo { if info.isReadonly != readonly { - return c.newIndexInfo(info.keyType, info.valueType, readonly, info.declaration) + return c.newIndexInfo(info.keyType, info.valueType, readonly, info.declaration, info.components) } return info } @@ -12928,7 +12928,7 @@ func (c *Checker) getUnionIndexInfos(types []*Type) []*IndexInfo { return c.getIndexTypeOfType(t, indexType) })) isReadonly := core.Some(types, func(t *Type) bool { return c.getIndexInfoOfType(t, indexType).isReadonly }) - result = append(result, c.newIndexInfo(indexType, valueType, isReadonly, nil)) + result = append(result, c.newIndexInfo(indexType, valueType, isReadonly, nil, nil)) } } return result @@ -17179,7 +17179,7 @@ func (c *Checker) getTypeFromObjectBindingPattern(pattern *ast.Node, includePatt for _, e := range pattern.AsBindingPattern().Elements.Nodes { name := e.PropertyNameOrName() if hasDotDotDotToken(e) { - stringIndexInfo = c.newIndexInfo(c.stringType, c.anyType, false /*isReadonly*/, nil) + stringIndexInfo = c.newIndexInfo(c.stringType, c.anyType, false /*isReadonly*/, nil, nil) continue } exprType := c.getLiteralTypeFromPropertyName(name) @@ -17580,7 +17580,7 @@ func (c *Checker) getWidenedTypeOfObjectLiteral(t *Type, context *WideningContex } } result := c.newAnonymousType(t.symbol, members, nil, nil, core.SameMap(c.getIndexInfosOfType(t), func(info *IndexInfo) *IndexInfo { - return c.newIndexInfo(info.keyType, c.getWidenedType(info.valueType), info.isReadonly, info.declaration) + return c.newIndexInfo(info.keyType, c.getWidenedType(info.valueType), info.isReadonly, info.declaration, info.components) })) // Retain js literal flag through widening result.objectFlags |= t.objectFlags & (ObjectFlagsJSLiteral | ObjectFlagsNonInferrableType) @@ -18187,7 +18187,7 @@ func (c *Checker) findApplicableIndexInfo(indexInfos []*IndexInfo, keyType *Type isReadonly = false } } - return c.newIndexInfo(c.unknownType, c.getIntersectionType(types), isReadonly, nil) + return c.newIndexInfo(c.unknownType, c.getIntersectionType(types), isReadonly, nil, nil) } } @@ -18794,7 +18794,7 @@ func (c *Checker) getIndexInfosOfIndexSymbol(indexSymbol *ast.Symbol, siblingSym } forEachType(c.getTypeFromTypeNode(typeNode), func(keyType *Type) { if c.isValidIndexKeyType(keyType) && findIndexInfo(indexInfos, keyType) == nil { - indexInfo := c.newIndexInfo(keyType, valueType, HasModifier(declaration, ast.ModifierFlagsReadonly), declaration) + indexInfo := c.newIndexInfo(keyType, valueType, HasModifier(declaration, ast.ModifierFlagsReadonly), declaration, nil) indexInfos = append(indexInfos, indexInfo) } }) @@ -18861,18 +18861,22 @@ func (c *Checker) getIndexInfosOfIndexSymbol(indexSymbol *ast.Symbol, siblingSym // NOTE: currently does not make pattern literal indexers, eg `${number}px` func (c *Checker) getObjectLiteralIndexInfo(isReadonly bool, properties []*ast.Symbol, keyType *Type) *IndexInfo { var propTypes []*Type + var components []*ast.Node for _, prop := range properties { if keyType == c.stringType && !c.isSymbolWithSymbolName(prop) || keyType == c.numberType && c.isSymbolWithNumericName(prop) || keyType == c.esSymbolType && c.isSymbolWithSymbolName(prop) { propTypes = append(propTypes, c.getTypeOfSymbol(prop)) + if c.isSymbolWithComputedName(prop) { + components = append(components, prop.Declarations[0]) + } } } unionType := c.undefinedType if len(propTypes) != 0 { unionType = c.getUnionTypeEx(propTypes, UnionReductionSubtype, nil, nil) } - return c.newIndexInfo(keyType, unionType, isReadonly, nil /*declaration*/) + return c.newIndexInfo(keyType, unionType, isReadonly, nil /*declaration*/, components) } func (c *Checker) isSymbolWithSymbolName(symbol *ast.Symbol) bool { @@ -18897,6 +18901,14 @@ func (c *Checker) isSymbolWithNumericName(symbol *ast.Symbol) bool { return false } +func (c *Checker) isSymbolWithComputedName(symbol *ast.Symbol) bool { + if len(symbol.Declarations) != 0 { + name := symbol.Declarations[0].Name() + return name != nil && ast.IsComputedPropertyName(name) + } + return false +} + func (c *Checker) isNumericName(name *ast.Node) bool { switch name.Kind { case ast.KindComputedPropertyName: @@ -19768,7 +19780,7 @@ func (c *Checker) instantiateIndexInfo(info *IndexInfo, m *TypeMapper) *IndexInf if newValueType == info.valueType { return info } - return c.newIndexInfo(info.keyType, newValueType, info.isReadonly, info.declaration) + return c.newIndexInfo(info.keyType, newValueType, info.isReadonly, info.declaration, info.components) } func (c *Checker) resolveAnonymousTypeMembers(t *Type) { @@ -20086,7 +20098,7 @@ func (c *Checker) resolveMappedTypeMembers(t *Type) { propType := c.instantiateType(templateType, appendTypeMapping(t.AsMappedType().mapper, typeParameter, keyType)) modifiersIndexInfo := c.getApplicableIndexInfo(modifiersType, propNameType) isReadonly := templateModifiers&MappedTypeModifiersIncludeReadonly != 0 || templateModifiers&MappedTypeModifiersExcludeReadonly == 0 && modifiersIndexInfo != nil && modifiersIndexInfo.isReadonly - indexInfo := c.newIndexInfo(indexKeyType, propType, isReadonly, nil) + indexInfo := c.newIndexInfo(indexKeyType, propType, isReadonly, nil, nil) indexInfos = c.appendIndexInfo(indexInfos, indexInfo, true /*union*/) } } @@ -20479,7 +20491,7 @@ func (c *Checker) appendIndexInfo(indexInfos []*IndexInfo, newInfo *IndexInfo, u valueType = c.getIntersectionType([]*Type{info.valueType, newInfo.valueType}) isReadonly = info.isReadonly && newInfo.isReadonly } - indexInfos[i] = c.newIndexInfo(info.keyType, valueType, isReadonly, nil) + indexInfos[i] = c.newIndexInfo(info.keyType, valueType, isReadonly, nil, nil) return indexInfos } } @@ -24316,12 +24328,13 @@ func (c *Checker) newSignature(flags SignatureFlags, declaration *ast.Node, type return sig } -func (c *Checker) newIndexInfo(keyType *Type, valueType *Type, isReadonly bool, declaration *ast.Node) *IndexInfo { +func (c *Checker) newIndexInfo(keyType *Type, valueType *Type, isReadonly bool, declaration *ast.Node, components []*ast.Node) *IndexInfo { info := c.indexInfoPool.New() info.keyType = keyType info.valueType = valueType info.isReadonly = isReadonly info.declaration = declaration + info.components = components return info } diff --git a/internal/checker/emitresolver.go b/internal/checker/emitresolver.go index df7011e5c4..044a06e843 100644 --- a/internal/checker/emitresolver.go +++ b/internal/checker/emitresolver.go @@ -1010,9 +1010,43 @@ func (r *emitResolver) CreateLateBoundIndexSignatures(emitContext *printer.EmitC if info == r.checker.anyBaseTypeIndexInfo { continue // inherited, but looks like a late-bound signature because it has no declarations } - // if info.components { - // !!! TODO: Complete late-bound index info support - getObjectLiteralIndexInfo does not yet add late bound components to index signatures - // } + if len(info.components) != 0 { + // !!! TODO: Complete late-bound index info support - getObjectLiteralIndexInfo does not yet add late bound components to index signatures + allComponentComputedNamesSerializable := enclosingDeclaration != nil && core.Every(info.components, func(c *ast.Node) bool { + return c.Name() != nil && + ast.IsComputedPropertyName(c.Name()) && + ast.IsEntityNameExpression(c.Name().AsComputedPropertyName().Expression) && + r.isEntityNameVisible(c.Name().AsComputedPropertyName().Expression, enclosingDeclaration, false).Accessibility == printer.SymbolAccessibilityAccessible + }) + if allComponentComputedNamesSerializable { + for _, c := range info.components { + if r.checker.hasLateBindableName(c) { + // skip late bound props that contribute to the index signature - they'll be preserved via other means + continue + } + + firstIdentifier := ast.GetFirstIdentifier(c.Name().Expression()) + name := r.checker.resolveName(firstIdentifier, firstIdentifier.Text(), ast.SymbolFlagsValue|ast.SymbolFlagsExportValue, nil /*nameNotFoundMessage*/, true /*isUse*/, false /*excludeGlobals*/) + if name != nil { + tracker.TrackSymbol(name, enclosingDeclaration, ast.SymbolFlagsValue) + } + + mods := core.IfElse(isStatic, []*ast.Node{emitContext.Factory.NewModifier(ast.KindStaticKeyword)}, nil) + if info.isReadonly { + mods = append(mods, emitContext.Factory.NewModifier(ast.KindReadonlyKeyword)) + } + + decl := emitContext.Factory.NewPropertyDeclaration( + core.IfElse(mods != nil, emitContext.Factory.NewModifierList(mods), nil), + c.Name(), + c.QuestionToken(), + requestNodeBuilder.TypeToTypeNode(r.checker.getTypeOfSymbol(c.Symbol()), enclosingDeclaration, flags, internalFlags, tracker), + nil, + ) + result = append(result, decl) + } + } + } node := requestNodeBuilder.IndexInfoToIndexSignatureDeclaration(info, enclosingDeclaration, flags, internalFlags, tracker) if node != nil && isStatic { modNodes := []*ast.Node{emitContext.Factory.NewModifier(ast.KindStaticKeyword)} diff --git a/internal/checker/inference.go b/internal/checker/inference.go index 2d8db851cc..d395f03a98 100644 --- a/internal/checker/inference.go +++ b/internal/checker/inference.go @@ -1035,7 +1035,7 @@ func (c *Checker) resolveReverseMappedTypeMembers(t *Type) { optionalMask := core.IfElse(modifiers&MappedTypeModifiersIncludeOptional != 0, 0, ast.SymbolFlagsOptional) var indexInfos []*IndexInfo if indexInfo != nil { - indexInfos = []*IndexInfo{c.newIndexInfo(c.stringType, core.OrElse(c.inferReverseMappedType(indexInfo.valueType, r.mappedType, r.constraintType), c.unknownType), readonlyMask && indexInfo.isReadonly, nil)} + indexInfos = []*IndexInfo{c.newIndexInfo(c.stringType, core.OrElse(c.inferReverseMappedType(indexInfo.valueType, r.mappedType, r.constraintType), c.unknownType), readonlyMask && indexInfo.isReadonly, nil, nil)} } members := make(ast.SymbolTable) limitedConstraint := c.getLimitedConstraint(t) @@ -1174,7 +1174,7 @@ func (c *Checker) createEmptyObjectTypeFromStringLiteral(t *Type) *Type { } var indexInfos []*IndexInfo if t.flags&TypeFlagsString != 0 { - indexInfos = []*IndexInfo{c.newIndexInfo(c.stringType, c.emptyObjectType, false /*isReadonly*/, nil)} + indexInfos = []*IndexInfo{c.newIndexInfo(c.stringType, c.emptyObjectType, false /*isReadonly*/, nil, nil)} } return c.newAnonymousType(nil, members, nil, nil, indexInfos) } diff --git a/internal/checker/types.go b/internal/checker/types.go index 5fd4b15830..0a66c81c2f 100644 --- a/internal/checker/types.go +++ b/internal/checker/types.go @@ -1198,7 +1198,8 @@ type IndexInfo struct { keyType *Type valueType *Type isReadonly bool - declaration *ast.Node // IndexSignatureDeclaration + declaration *ast.Node // IndexSignatureDeclaration + components []*ast.Node // ElementWithComputedPropertyName } /** diff --git a/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js b/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js index b62a61483a..6ec291b323 100644 --- a/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js +++ b/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js @@ -27,7 +27,9 @@ export const Mixer = Mix(class { //// [classNonUniqueSymbolMethodHasSymbolIndexer.d.ts] +declare const a: symbol; export declare class A { + [a]: () => number; [x: symbol]: () => number; } export declare const Mixer: { @@ -37,3 +39,4 @@ export declare const Mixer: { } & (new (...args: any[]) => { mixed: true; }); +export {}; diff --git a/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js.diff b/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js.diff index 3fc3e62d5f..f362c47022 100644 --- a/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js.diff +++ b/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js.diff @@ -1,12 +1,9 @@ --- old.classNonUniqueSymbolMethodHasSymbolIndexer.js +++ new.classNonUniqueSymbolMethodHasSymbolIndexer.js -@@= skipped -26, +26 lines =@@ - - - //// [classNonUniqueSymbolMethodHasSymbolIndexer.d.ts] --declare const a: symbol; +@@= skipped -29, +29 lines =@@ + declare const a: symbol; export declare class A { -- [a]: () => number; + [a]: () => number; + [x: symbol]: () => number; } export declare const Mixer: { @@ -15,6 +12,4 @@ + [x: symbol]: () => number; }; } & (new (...args: any[]) => { - mixed: true; - }); --export {}; \ No newline at end of file + mixed: true; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js b/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js index 08668626a9..084c639b8c 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js @@ -24,6 +24,8 @@ exports.C = C; //// [main.d.ts] +import Test from "abcdefgh"; export declare class C { + [Test.someKey]: () => void; [x: number]: () => void; } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js.diff index 3d15f16ec7..0fe7eaa2c2 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js.diff @@ -9,12 +9,9 @@ class C { [abcdefgh_1.default.someKey]() { } ; -@@= skipped -9, +9 lines =@@ - - - //// [main.d.ts] --import Test from "abcdefgh"; +@@= skipped -12, +12 lines =@@ + import Test from "abcdefgh"; export declare class C { -- [Test.someKey]: () => void; + [Test.someKey]: () => void; + [x: number]: () => void; } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js b/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js index 8eb1c64ce6..ac83be52ae 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js @@ -29,6 +29,7 @@ exports.a = (new WithData())["ahahahaahah"](); //// [declarationEmitComputedNameWithQuestionToken.d.ts] export declare const dataSomething: `data-${string}`; export declare class WithData { + [dataSomething]?: () => string; [x: string]: () => string; } export declare const a: string; diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js.diff index 601c50ed08..4fe4383392 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js.diff @@ -1,10 +1,9 @@ --- old.declarationEmitComputedNameWithQuestionToken.js +++ new.declarationEmitComputedNameWithQuestionToken.js -@@= skipped -28, +28 lines =@@ - //// [declarationEmitComputedNameWithQuestionToken.d.ts] +@@= skipped -29, +29 lines =@@ export declare const dataSomething: `data-${string}`; export declare class WithData { -- [dataSomething]?: () => string; + [dataSomething]?: () => string; + [x: string]: () => string; } export declare const a: string; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js b/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js index b6044cbda9..bed4d13d92 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js @@ -21,8 +21,10 @@ exports.Test = Test; //// [declarationEmitMultipleComputedNamesSameDomain.d.ts] +declare const x: string; declare const y: "y"; export declare class Test { + [x]: number; [x: string]: number; [y]: number; } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js.diff index 595c7bbd25..3ae0496ac5 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js.diff @@ -20,10 +20,10 @@ //// [declarationEmitMultipleComputedNamesSameDomain.d.ts] --declare const x: string; +@@= skipped -18, +14 lines =@@ declare const y: "y"; export declare class Test { -- [x]: number; + [x]: number; + [x: string]: number; [y]: number; } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js b/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js index d34e9d34dd..d2e91ef8c5 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js @@ -73,12 +73,23 @@ export declare const fieldName: string; export declare const conatainer: { [x: string]: () => string; }; +declare const classFieldName: string; +declare const otherField: string; +declare const staticField: string; export declare class Holder { + static [staticField]: () => { + static: boolean; + }; + static [staticField]: () => { + static: string; + }; static [x: string]: Holder | (() => { static: boolean; }) | (() => { static: string; }); + [classFieldName]: () => string; + [otherField]: () => number; [x: string]: (() => string) | (() => number); } /** @@ -90,3 +101,4 @@ export declare const staticLookup: Holder | (() => { static: string; }); export declare const instanceLookup: (() => string) | (() => number); +export {}; diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js.diff index ff455c9ac1..8de62dcb35 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js.diff @@ -7,27 +7,20 @@ - [fieldName]: () => string; + [x: string]: () => string; }; --declare const classFieldName: string; --declare const otherField: string; --declare const staticField: string; - export declare class Holder { -- static [staticField]: () => { + declare const classFieldName: string; + declare const otherField: string; +@@= skipped -12, +12 lines =@@ + static [staticField]: () => { + static: string; + }; + static [x: string]: Holder | (() => { - static: boolean; -- }; -- static [staticField]: () => { ++ static: boolean; + }) | (() => { - static: string; -- }; -- [classFieldName]: () => string; -- [otherField]: () => number; ++ static: string; + }); + [classFieldName]: () => string; + [otherField]: () => number; + [x: string]: (() => string) | (() => number); } /** - * Could be `"prototype"`, so all static string indexers include the instance type -@@= skipped -24, +19 lines =@@ - static: string; - }); - export declare const instanceLookup: (() => string) | (() => number); --export {}; \ No newline at end of file + * Could be `"prototype"`, so all static string indexers include the instance type \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js index 5b6872ec8b..11ce03496a 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js @@ -113,8 +113,13 @@ export declare class Cls { set getSetOk3(value: number); } declare let noAnnotationStringName: string; +declare let noParamAnnotationStringName: string; declare const noAnnotationLiteralName = "noAnnotationLiteralName"; export declare class C { + [noAnnotationStringName]: () => void; + [noParamAnnotationStringName]: (v: any) => void; + [noAnnotationStringName]: number; + [noParamAnnotationStringName]: any; [x: string]: any; [x: number]: number; } diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js.diff b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js.diff index 8c37d0e27a..24795b2c09 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js.diff +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js.diff @@ -25,8 +25,13 @@ + set getSetOk3(value: number); +} +declare let noAnnotationStringName: string; ++declare let noParamAnnotationStringName: string; +declare const noAnnotationLiteralName = "noAnnotationLiteralName"; +export declare class C { ++ [noAnnotationStringName]: () => void; ++ [noParamAnnotationStringName]: (v: any) => void; ++ [noAnnotationStringName]: number; ++ [noParamAnnotationStringName]: any; + [x: string]: any; + [x: number]: number; +} diff --git a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js index 9066e8c7d5..6b2747fcbe 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js +++ b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js @@ -31,19 +31,24 @@ class Derived3 extends Base3 { //// [overrideDynamicName1.d.ts] declare let prop: string; declare class Base1 { + [prop]: () => void; [x: string]: () => void; } declare class Derived1 extends Base1 { + [prop]: () => void; [x: string]: () => void; } declare class Base2 { + [prop]: () => void; [x: string]: () => void; } declare class Derived2 extends Base2 { + [prop]: () => void; [x: string]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { + [prop]: () => void; [x: string]: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js.diff b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js.diff index 34284ac0bb..21fba4349b 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js.diff +++ b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js.diff @@ -1,27 +1,26 @@ --- old.overrideDynamicName1(noimplicitoverride=false).js +++ new.overrideDynamicName1(noimplicitoverride=false).js -@@= skipped -30, +30 lines =@@ - //// [overrideDynamicName1.d.ts] +@@= skipped -31, +31 lines =@@ declare let prop: string; declare class Base1 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } declare class Derived1 extends Base1 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } declare class Base2 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } declare class Derived2 extends Base2 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js index 9066e8c7d5..6b2747fcbe 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js +++ b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js @@ -31,19 +31,24 @@ class Derived3 extends Base3 { //// [overrideDynamicName1.d.ts] declare let prop: string; declare class Base1 { + [prop]: () => void; [x: string]: () => void; } declare class Derived1 extends Base1 { + [prop]: () => void; [x: string]: () => void; } declare class Base2 { + [prop]: () => void; [x: string]: () => void; } declare class Derived2 extends Base2 { + [prop]: () => void; [x: string]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { + [prop]: () => void; [x: string]: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js.diff b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js.diff index 2e165cc50c..2f73197573 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js.diff +++ b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js.diff @@ -1,27 +1,26 @@ --- old.overrideDynamicName1(noimplicitoverride=true).js +++ new.overrideDynamicName1(noimplicitoverride=true).js -@@= skipped -30, +30 lines =@@ - //// [overrideDynamicName1.d.ts] +@@= skipped -31, +31 lines =@@ declare let prop: string; declare class Base1 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } declare class Derived1 extends Base1 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } declare class Base2 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } declare class Derived2 extends Base2 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { -- [prop]: () => void; + [prop]: () => void; + [x: string]: () => void; } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js index d02cbd16d4..b01624669b 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js +++ b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js @@ -31,19 +31,24 @@ class Derived3 extends Base3 { //// [overrideLateBindableIndexSignature1.d.ts] declare const sym: symbol; declare class Base1 { + [sym]: () => void; [x: symbol]: () => void; } declare class Derived1 extends Base1 { + [sym]: () => void; [x: symbol]: () => void; } declare class Base2 { + [sym]: () => void; [x: symbol]: () => void; } declare class Derived2 extends Base2 { + [sym]: () => void; [x: symbol]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { + [sym]: () => void; [x: symbol]: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js.diff b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js.diff index c75aebda7f..b8f780db1d 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js.diff +++ b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js.diff @@ -1,27 +1,26 @@ --- old.overrideLateBindableIndexSignature1(noimplicitoverride=false).js +++ new.overrideLateBindableIndexSignature1(noimplicitoverride=false).js -@@= skipped -30, +30 lines =@@ - //// [overrideLateBindableIndexSignature1.d.ts] +@@= skipped -31, +31 lines =@@ declare const sym: symbol; declare class Base1 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } declare class Derived1 extends Base1 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } declare class Base2 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } declare class Derived2 extends Base2 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js index d02cbd16d4..b01624669b 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js +++ b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js @@ -31,19 +31,24 @@ class Derived3 extends Base3 { //// [overrideLateBindableIndexSignature1.d.ts] declare const sym: symbol; declare class Base1 { + [sym]: () => void; [x: symbol]: () => void; } declare class Derived1 extends Base1 { + [sym]: () => void; [x: symbol]: () => void; } declare class Base2 { + [sym]: () => void; [x: symbol]: () => void; } declare class Derived2 extends Base2 { + [sym]: () => void; [x: symbol]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { + [sym]: () => void; [x: symbol]: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js.diff b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js.diff index 4e4a90ffc6..e48ec4e274 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js.diff +++ b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js.diff @@ -1,27 +1,26 @@ --- old.overrideLateBindableIndexSignature1(noimplicitoverride=true).js +++ new.overrideLateBindableIndexSignature1(noimplicitoverride=true).js -@@= skipped -30, +30 lines =@@ - //// [overrideLateBindableIndexSignature1.d.ts] +@@= skipped -31, +31 lines =@@ declare const sym: symbol; declare class Base1 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } declare class Derived1 extends Base1 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } declare class Base2 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } declare class Derived2 extends Base2 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { -- [sym]: () => void; + [sym]: () => void; + [x: symbol]: () => void; } \ No newline at end of file From f8a0516fa14cbfea256a36e899f65913796465fa Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 17 Sep 2025 11:16:09 -0700 Subject: [PATCH 2/2] Add missing continue --- internal/checker/emitresolver.go | 1 + ...ssNonUniqueSymbolMethodHasSymbolIndexer.js | 1 - ...UniqueSymbolMethodHasSymbolIndexer.js.diff | 6 +---- ...clarationEmitAnyComputedPropertyInClass.js | 1 - ...tionEmitAnyComputedPropertyInClass.js.diff | 8 +----- ...rationEmitComputedNameWithQuestionToken.js | 1 - ...nEmitComputedNameWithQuestionToken.js.diff | 9 ------- ...tionEmitMultipleComputedNamesSameDomain.js | 1 - ...mitMultipleComputedNamesSameDomain.js.diff | 10 +------ .../declarationEmitSimpleComputedNames1.js | 6 ----- ...eclarationEmitSimpleComputedNames1.js.diff | 17 +----------- .../isolatedDeclarationErrorsClasses.js | 1 - .../isolatedDeclarationErrorsClasses.js.diff | 1 - ...eDynamicName1(noimplicitoverride=false).js | 5 ---- ...micName1(noimplicitoverride=false).js.diff | 26 ------------------- ...deDynamicName1(noimplicitoverride=true).js | 5 ---- ...amicName1(noimplicitoverride=true).js.diff | 26 ------------------- ...dexSignature1(noimplicitoverride=false).js | 5 ---- ...gnature1(noimplicitoverride=false).js.diff | 26 ------------------- ...ndexSignature1(noimplicitoverride=true).js | 5 ---- ...ignature1(noimplicitoverride=true).js.diff | 26 ------------------- 21 files changed, 5 insertions(+), 182 deletions(-) delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js.diff diff --git a/internal/checker/emitresolver.go b/internal/checker/emitresolver.go index 044a06e843..40bd253bc2 100644 --- a/internal/checker/emitresolver.go +++ b/internal/checker/emitresolver.go @@ -1045,6 +1045,7 @@ func (r *emitResolver) CreateLateBoundIndexSignatures(emitContext *printer.EmitC ) result = append(result, decl) } + continue } } node := requestNodeBuilder.IndexInfoToIndexSignatureDeclaration(info, enclosingDeclaration, flags, internalFlags, tracker) diff --git a/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js b/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js index 6ec291b323..d2adefb662 100644 --- a/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js +++ b/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js @@ -30,7 +30,6 @@ export const Mixer = Mix(class { declare const a: symbol; export declare class A { [a]: () => number; - [x: symbol]: () => number; } export declare const Mixer: { new (): { diff --git a/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js.diff b/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js.diff index f362c47022..d64056e43a 100644 --- a/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js.diff +++ b/testdata/baselines/reference/submodule/compiler/classNonUniqueSymbolMethodHasSymbolIndexer.js.diff @@ -1,10 +1,6 @@ --- old.classNonUniqueSymbolMethodHasSymbolIndexer.js +++ new.classNonUniqueSymbolMethodHasSymbolIndexer.js -@@= skipped -29, +29 lines =@@ - declare const a: symbol; - export declare class A { - [a]: () => number; -+ [x: symbol]: () => number; +@@= skipped -32, +32 lines =@@ } export declare const Mixer: { new (): { diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js b/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js index 084c639b8c..96def849ed 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js @@ -27,5 +27,4 @@ exports.C = C; import Test from "abcdefgh"; export declare class C { [Test.someKey]: () => void; - [x: number]: () => void; } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js.diff index 0fe7eaa2c2..709671dfb3 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitAnyComputedPropertyInClass.js.diff @@ -8,10 +8,4 @@ +const abcdefgh_1 = require("abcdefgh"); class C { [abcdefgh_1.default.someKey]() { } - ; -@@= skipped -12, +12 lines =@@ - import Test from "abcdefgh"; - export declare class C { - [Test.someKey]: () => void; -+ [x: number]: () => void; - } \ No newline at end of file + ; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js b/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js index ac83be52ae..c852683733 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js @@ -30,6 +30,5 @@ exports.a = (new WithData())["ahahahaahah"](); export declare const dataSomething: `data-${string}`; export declare class WithData { [dataSomething]?: () => string; - [x: string]: () => string; } export declare const a: string; diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js.diff deleted file mode 100644 index 4fe4383392..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitComputedNameWithQuestionToken.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.declarationEmitComputedNameWithQuestionToken.js -+++ new.declarationEmitComputedNameWithQuestionToken.js -@@= skipped -29, +29 lines =@@ - export declare const dataSomething: `data-${string}`; - export declare class WithData { - [dataSomething]?: () => string; -+ [x: string]: () => string; - } - export declare const a: string; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js b/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js index bed4d13d92..985bc81218 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js @@ -25,7 +25,6 @@ declare const x: string; declare const y: "y"; export declare class Test { [x]: number; - [x: string]: number; [y]: number; } export {}; diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js.diff index 3ae0496ac5..cb0e618742 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitMultipleComputedNamesSameDomain.js.diff @@ -19,12 +19,4 @@ -_a = x, _b = y; - //// [declarationEmitMultipleComputedNamesSameDomain.d.ts] -@@= skipped -18, +14 lines =@@ - declare const y: "y"; - export declare class Test { - [x]: number; -+ [x: string]: number; - [y]: number; - } - export {}; \ No newline at end of file + //// [declarationEmitMultipleComputedNamesSameDomain.d.ts] \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js b/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js index d2e91ef8c5..22b7159d60 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js @@ -83,14 +83,8 @@ export declare class Holder { static [staticField]: () => { static: string; }; - static [x: string]: Holder | (() => { - static: boolean; - }) | (() => { - static: string; - }); [classFieldName]: () => string; [otherField]: () => number; - [x: string]: (() => string) | (() => number); } /** * Could be `"prototype"`, so all static string indexers include the instance type diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js.diff index 8de62dcb35..9caf44fdeb 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitSimpleComputedNames1.js.diff @@ -8,19 +8,4 @@ + [x: string]: () => string; }; declare const classFieldName: string; - declare const otherField: string; -@@= skipped -12, +12 lines =@@ - static [staticField]: () => { - static: string; - }; -+ static [x: string]: Holder | (() => { -+ static: boolean; -+ }) | (() => { -+ static: string; -+ }); - [classFieldName]: () => string; - [otherField]: () => number; -+ [x: string]: (() => string) | (() => number); - } - /** - * Could be `"prototype"`, so all static string indexers include the instance type \ No newline at end of file + declare const otherField: string; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js index 11ce03496a..daf465c885 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js @@ -120,7 +120,6 @@ export declare class C { [noParamAnnotationStringName]: (v: any) => void; [noAnnotationStringName]: number; [noParamAnnotationStringName]: any; - [x: string]: any; [x: number]: number; } export interface I { diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js.diff b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js.diff index 24795b2c09..b32b1d0c33 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js.diff +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.js.diff @@ -32,7 +32,6 @@ + [noParamAnnotationStringName]: (v: any) => void; + [noAnnotationStringName]: number; + [noParamAnnotationStringName]: any; -+ [x: string]: any; + [x: number]: number; +} +export interface I { diff --git a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js index 6b2747fcbe..22e2a11cfe 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js +++ b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js @@ -32,23 +32,18 @@ class Derived3 extends Base3 { declare let prop: string; declare class Base1 { [prop]: () => void; - [x: string]: () => void; } declare class Derived1 extends Base1 { [prop]: () => void; - [x: string]: () => void; } declare class Base2 { [prop]: () => void; - [x: string]: () => void; } declare class Derived2 extends Base2 { [prop]: () => void; - [x: string]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { [prop]: () => void; - [x: string]: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js.diff b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js.diff deleted file mode 100644 index 21fba4349b..0000000000 --- a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=false).js.diff +++ /dev/null @@ -1,26 +0,0 @@ ---- old.overrideDynamicName1(noimplicitoverride=false).js -+++ new.overrideDynamicName1(noimplicitoverride=false).js -@@= skipped -31, +31 lines =@@ - declare let prop: string; - declare class Base1 { - [prop]: () => void; -+ [x: string]: () => void; - } - declare class Derived1 extends Base1 { - [prop]: () => void; -+ [x: string]: () => void; - } - declare class Base2 { - [prop]: () => void; -+ [x: string]: () => void; - } - declare class Derived2 extends Base2 { - [prop]: () => void; -+ [x: string]: () => void; - } - declare class Base3 { - } - declare class Derived3 extends Base3 { - [prop]: () => void; -+ [x: string]: () => void; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js index 6b2747fcbe..22e2a11cfe 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js +++ b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js @@ -32,23 +32,18 @@ class Derived3 extends Base3 { declare let prop: string; declare class Base1 { [prop]: () => void; - [x: string]: () => void; } declare class Derived1 extends Base1 { [prop]: () => void; - [x: string]: () => void; } declare class Base2 { [prop]: () => void; - [x: string]: () => void; } declare class Derived2 extends Base2 { [prop]: () => void; - [x: string]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { [prop]: () => void; - [x: string]: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js.diff b/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js.diff deleted file mode 100644 index 2f73197573..0000000000 --- a/testdata/baselines/reference/submodule/conformance/overrideDynamicName1(noimplicitoverride=true).js.diff +++ /dev/null @@ -1,26 +0,0 @@ ---- old.overrideDynamicName1(noimplicitoverride=true).js -+++ new.overrideDynamicName1(noimplicitoverride=true).js -@@= skipped -31, +31 lines =@@ - declare let prop: string; - declare class Base1 { - [prop]: () => void; -+ [x: string]: () => void; - } - declare class Derived1 extends Base1 { - [prop]: () => void; -+ [x: string]: () => void; - } - declare class Base2 { - [prop]: () => void; -+ [x: string]: () => void; - } - declare class Derived2 extends Base2 { - [prop]: () => void; -+ [x: string]: () => void; - } - declare class Base3 { - } - declare class Derived3 extends Base3 { - [prop]: () => void; -+ [x: string]: () => void; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js index b01624669b..17d12eb6de 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js +++ b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js @@ -32,23 +32,18 @@ class Derived3 extends Base3 { declare const sym: symbol; declare class Base1 { [sym]: () => void; - [x: symbol]: () => void; } declare class Derived1 extends Base1 { [sym]: () => void; - [x: symbol]: () => void; } declare class Base2 { [sym]: () => void; - [x: symbol]: () => void; } declare class Derived2 extends Base2 { [sym]: () => void; - [x: symbol]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { [sym]: () => void; - [x: symbol]: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js.diff b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js.diff deleted file mode 100644 index b8f780db1d..0000000000 --- a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=false).js.diff +++ /dev/null @@ -1,26 +0,0 @@ ---- old.overrideLateBindableIndexSignature1(noimplicitoverride=false).js -+++ new.overrideLateBindableIndexSignature1(noimplicitoverride=false).js -@@= skipped -31, +31 lines =@@ - declare const sym: symbol; - declare class Base1 { - [sym]: () => void; -+ [x: symbol]: () => void; - } - declare class Derived1 extends Base1 { - [sym]: () => void; -+ [x: symbol]: () => void; - } - declare class Base2 { - [sym]: () => void; -+ [x: symbol]: () => void; - } - declare class Derived2 extends Base2 { - [sym]: () => void; -+ [x: symbol]: () => void; - } - declare class Base3 { - } - declare class Derived3 extends Base3 { - [sym]: () => void; -+ [x: symbol]: () => void; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js index b01624669b..17d12eb6de 100644 --- a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js +++ b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js @@ -32,23 +32,18 @@ class Derived3 extends Base3 { declare const sym: symbol; declare class Base1 { [sym]: () => void; - [x: symbol]: () => void; } declare class Derived1 extends Base1 { [sym]: () => void; - [x: symbol]: () => void; } declare class Base2 { [sym]: () => void; - [x: symbol]: () => void; } declare class Derived2 extends Base2 { [sym]: () => void; - [x: symbol]: () => void; } declare class Base3 { } declare class Derived3 extends Base3 { [sym]: () => void; - [x: symbol]: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js.diff b/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js.diff deleted file mode 100644 index e48ec4e274..0000000000 --- a/testdata/baselines/reference/submodule/conformance/overrideLateBindableIndexSignature1(noimplicitoverride=true).js.diff +++ /dev/null @@ -1,26 +0,0 @@ ---- old.overrideLateBindableIndexSignature1(noimplicitoverride=true).js -+++ new.overrideLateBindableIndexSignature1(noimplicitoverride=true).js -@@= skipped -31, +31 lines =@@ - declare const sym: symbol; - declare class Base1 { - [sym]: () => void; -+ [x: symbol]: () => void; - } - declare class Derived1 extends Base1 { - [sym]: () => void; -+ [x: symbol]: () => void; - } - declare class Base2 { - [sym]: () => void; -+ [x: symbol]: () => void; - } - declare class Derived2 extends Base2 { - [sym]: () => void; -+ [x: symbol]: () => void; - } - declare class Base3 { - } - declare class Derived3 extends Base3 { - [sym]: () => void; -+ [x: symbol]: () => void; - } \ No newline at end of file