diff --git a/src/services/codefixes/helpers.ts b/src/services/codefixes/helpers.ts index 2f6e4f06796..b09c4ac334b 100644 --- a/src/services/codefixes/helpers.ts +++ b/src/services/codefixes/helpers.ts @@ -124,21 +124,21 @@ namespace ts.codefix { for (const accessor of orderedAccessors) { if (isGetAccessorDeclaration(accessor)) { addClassElement(factory.createGetAccessorDeclaration( - modifiers, - name, + getSynthesizedDeepClones(modifiers), + getSynthesizedDeepClone(name), emptyArray, - typeNode, - ambient ? undefined : body || createStubbedMethodBody(quotePreference))); + getSynthesizedDeepClone(typeNode), + ambient ? undefined : createStubbedMethodBody(quotePreference))); } else { Debug.assertNode(accessor, isSetAccessorDeclaration, "The counterpart to a getter should be a setter"); const parameter = getSetAccessorValueParameter(accessor); const parameterName = parameter && isIdentifier(parameter.name) ? idText(parameter.name) : undefined; addClassElement(factory.createSetAccessorDeclaration( - modifiers, - name, - createDummyParameters(1, [parameterName], [typeNode], 1, /*inJs*/ false), - ambient ? undefined : body || createStubbedMethodBody(quotePreference))); + getSynthesizedDeepClones(modifiers), + getSynthesizedDeepClone(name), + createDummyParameters(1, [parameterName], [getSynthesizedDeepClone(typeNode)], 1, /*inJs*/ false), + ambient ? undefined : createStubbedMethodBody(quotePreference))); } } break;