@@ -130,10 +130,11 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
130
130
ascript-normal(term, t3(c"Arrow", typeof-lhs(lhs), return-type) && misc-tt);
131
131
);
132
132
App{ is-cons=is-cons, l=left, r=right } => (
133
+ let is-macro = false;
133
134
if is-cons {
134
135
(tctx, let new-l) = std-infer-expr(tctx, l, false, Used, TAny);
135
136
(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) };
137
138
ascript-normal(term, if is(used, Tail) then typeof(r) else t3(c"Cons", typeof(l), typeof(r)));
138
139
} else {
139
140
let rt = TAny;
@@ -156,6 +157,7 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
156
157
157
158
if index-macro-table.has(var-name-if-var(l)) {
158
159
(tctx, term) = std-apply-macro(tctx, term);
160
+ is-macro = true;
159
161
} else {
160
162
(tctx, let new-l) = std-infer-expr(tctx, l, false, used, TAny);
161
163
if typeof(l).is-arrow {
@@ -175,7 +177,7 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
175
177
};
176
178
};
177
179
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 {
179
181
mark-var-to-def-todo(tctx, var-name-if-var(l), typeof(r), l);
180
182
};
181
183
);
0 commit comments