@@ -130,10 +130,11 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
130130 ascript-normal(term, t3(c"Arrow", typeof-lhs(lhs), return-type) && misc-tt);
131131 );
132132 App{ is-cons=is-cons, l=left, r=right } => (
133+ let is-macro = false;
133134 if is-cons {
134135 (tctx, let new-l) = std-infer-expr(tctx, l, false, Used, TAny);
135136 (tctx, let new-r) = std-infer-expr(tctx, r, false, Used, TAny);
136- if not(is(l,new-l)) || not(is(r,new-r)) then { term = mk-cons(new-l, new-r) };
137+ if not(is(l,new-l)) || not(is(r,new-r)) then { l = new-l; r = new-r; term = mk-cons(new-l, new-r) };
137138 ascript-normal(term, if is(used, Tail) then typeof(r) else t3(c"Cons", typeof(l), typeof(r)));
138139 } else {
139140 let rt = TAny;
@@ -156,6 +157,7 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
156157
157158 if index-macro-table.has(var-name-if-var(l)) {
158159 (tctx, term) = std-apply-macro(tctx, term);
160+ is-macro = true;
159161 } else {
160162 (tctx, let new-l) = std-infer-expr(tctx, l, false, used, TAny);
161163 if typeof(l).is-arrow {
@@ -175,7 +177,7 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
175177 };
176178 };
177179
178- if not(index -macro-table.has(var-name-if-var(l)) ) && not(is-cons) && non-zero(var-name-if-var(l)) && typeof(l).is-arrow {
180+ if not(is -macro) && not(is-cons) && non-zero(var-name-if-var(l)) && typeof(l).is-arrow {
179181 mark-var-to-def-todo(tctx, var-name-if-var(l), typeof(r), l);
180182 };
181183 );
0 commit comments