diff --git a/incremental/compiler-plugin/src/analysis-visitor.ts b/incremental/compiler-plugin/src/analysis-visitor.ts index f8d75d9a9a7ae22675d75c3d5dcb5d37634e1662..bc2b723243143674e2438539c029c00a542646ef 100644 --- a/incremental/compiler-plugin/src/analysis-visitor.ts +++ b/incremental/compiler-plugin/src/analysis-visitor.ts @@ -28,7 +28,8 @@ import { arrayAt, getDeclarationsByNode, findFunctionDeclaration, - isMemoEntry + isMemoEntry, + skipParenthesizedExpression, } from "./util" import { ImportExport } from './import-export'; @@ -235,13 +236,17 @@ export class AnalysisVisitor extends AbstractVisitor { if (ts.getOriginalNode(node) !== node) throw new Error("Analysis phase is expected to work on original nodes") if (ts.isCallExpression(node)) { - if (ts.isIdentifier(node.expression)) { - const kind = this.callIsEligible(node.expression) + let node_expr: ts.Expression = node.expression + if (ts.isParenthesizedExpression(node.expression)) { + node_expr = skipParenthesizedExpression(node.expression) + } + if (ts.isIdentifier(node_expr)) { + const kind = this.callIsEligible(node_expr) if (kind) { this.rewrite.callTable.set(node, kind) } - } else if (ts.isPropertyAccessExpression(node.expression)) { - const member = node.expression.name + } else if (ts.isPropertyAccessExpression(node_expr)) { + const member = node_expr.name const kind = this.methodCallIsEligible(member) if (kind) { this.rewrite.callTable.set(node, kind)