Skip to content

Commit

Permalink
Fix #66
Browse files Browse the repository at this point in the history
  • Loading branch information
GoogleFeud committed Aug 22, 2023
1 parent 6e11d4e commit f6a3aaf
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export class MacroTransformer {
const statements: Array<ts.Statement> = [];
this.addEscapeScope();
for (const stmt of node.statements) {

if (ts.isImportDeclaration(stmt) && stmt.importClause && !stmt.importClause.isTypeOnly) {
if (stmt.importClause.namedBindings && ts.isNamedImports(stmt.importClause.namedBindings)) {
const filtered = stmt.importClause.namedBindings.elements.filter(el => {
Expand Down Expand Up @@ -566,12 +565,8 @@ export class MacroTransformer {
}
if (!macro || !macro.body) {
const calledSym = resolveAliasedSymbol(this.checker, this.checker.getSymbolAtLocation(name));
if (calledSym?.declarations?.length) {
this.boundVisitor(calledSym.declarations[0]);
return this.runMacroFromCallExpression(call, name, target);
} else {
return;
}
if (calledSym?.declarations?.length && !this.boundVisitor(calledSym.declarations[0])) return this.runMacroFromCallExpression(call, name, target);
else return;
}
return this.execMacro(macro, normalArgs, call, target);
}
Expand Down

0 comments on commit f6a3aaf

Please sign in to comment.