You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to call .addTypeArguments() on a ExpressionWithTypeArguments that contains a mixin results in an exception:
/Users/mak13180/site/esri/arcgis-web-components-3/node_modules/@ts-morph/common/dist/ts-morph-common.js:438throw new InvalidOperationError(typeof errorMessage === "string" ? errorMessage : errorMessage(), node);^InvalidOperationError: A child of the kind Identifier was expected./Users/mak13180/site/esri/arcgis-web-components-3/packages/support-packages/jsapi-extractor/test.ts:1:17> 1 | class A extends B(C) {}at Object.throwIfNullOrUndefined (/Users/mak13180/site/esri/arcgis-web-components-3/node_modules/@ts-morph/common/dist/ts-morph-common.js:438:19)at ExpressionWithTypeArguments.getFirstChildByKindOrThrow (/Users/mak13180/site/esri/arcgis-web-components-3/node_modules/ts-morph/dist/ts-morph.js:3857:30)at ExpressionWithTypeArguments.insertTypeArguments (/Users/mak13180/site/esri/arcgis-web-components-3/node_modules/ts-morph/dist/ts-morph.js:10126:41)at ExpressionWithTypeArguments.addTypeArguments (/Users/mak13180/site/esri/arcgis-web-components-3/node_modules/ts-morph/dist/ts-morph.js:10115:25)at <anonymous> (/Users/mak13180/site/esri/arcgis-web-components-3/packages/support-packages/jsapi-extractor/src/temp.ts:11:14)at ModuleJob.run (node:internal/modules/esm/module_job:271:25)at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)Node.js v22.12.0
Version: 25.0.1
To Reproduce
import{Project,SyntaxKind}from"ts-morph";constproject=newProject();constsourceFile=project.createSourceFile("test.ts","class A extends B(C) {}");constexpression=sourceFile.getFirstDescendantByKindOrThrow(SyntaxKind.ExpressionWithTypeArguments);expression.addTypeArguments(["D"]);
Expected behavior
No exception should occur.
Source file should be modified to look as follows:
Trying to call .addTypeArguments() on a ExpressionWithTypeArguments that contains a mixin results in an exception:
Version: 25.0.1
To Reproduce
Expected behavior
No exception should occur.
Source file should be modified to look as follows:
Workaround
Use .replaceText():
Extra details
Bug occurs here:
ts-morph/packages/ts-morph/src/compiler/ast/base/TypeArgumentedNode.ts
Line 89 in a1c61c7
Code should be modified to handle the case that TypeArgumentedNode contains something other than identifier
The text was updated successfully, but these errors were encountered: