Skip to content

Commit 0c585a6

Browse files
delay typechecking as long as possible
1 parent 1eb5624 commit 0c585a6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

PLATFORM/C/LIB/common-macros.lsts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ typed macro macro::set(lhs: lazy, rhs: lazy): lazy = (
77
mov(rhs, lhs)
88
);
99

10-
#typed macro macro::set(base field: macro::lhs-field, rhs: lazy): lazy = (
11-
# macro::concat(l"set.", field) (base, rhs)
12-
#);
13-
1410
typed macro macro::set(base index: macro::lhs-index, rhs: lazy): lazy = (
1511
$"set[]"( $"macro::lhs-as-rhs"(base), index, rhs )
1612
);
1713

14+
#typed macro macro::set(base field: macro::lhs-field, rhs: lazy): lazy = (
15+
# macro::concat(l"set.", field) (base, rhs)
16+
#);
17+
1818
typed macro macro::lhs-as-rhs(v: macro::variable): lazy = (
1919
v
2020
);

SRC/std-apply-macro-candidates.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ let std-apply-macro-candidates(tctx: TContext?, mname: CString, margs: AST, cand
1212
(let new-tctx, let mctx) = std-try-destructure-macro(tctx, margs, ctype, mlhs);
1313
if mctx.is-some then mctx = union(mctx, Some{extract-uuids(mrhs)});
1414
if mctx.is-some then t = with-location-preserve(substitute(mctx.get-or-panic, mrhs), margs.location);
15+
if not(non-zero(t)) then print("Rejected Candidate \{mname} \{mlhs}\n");
1516
}
1617
};
17-
(tctx, t) = std-infer-expr(tctx, t, false, Used, TAny);
1818
(tctx, t)
1919
);
2020

SRC/std-apply-macro.lsts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ let std-apply-macro(tctx: Maybe<TContext>, mname: CString, margs: AST, strong: B
4949
(tctx, let result) = std-apply-macro-candidates(tctx, mname, margs, candidates);
5050
if strong && not(non-zero(result)) then exit-error("Failed to Apply Macro: \{mname}", margs);
5151
print("Applied Macro \{mname} \{margs}\nResult: \{result}\n");
52+
if strong then (tctx, result) = std-infer-expr(tctx, result, false, Used, TAny);
5253
(tctx, result)
5354
);
5455

@@ -67,6 +68,7 @@ let std-infer-peeped-arguments(tctx: Maybe<TContext>, t: AST, peep: Type): (Type
6768
}
6869
);
6970
TAny{} => (ta, t);
71+
TVar{} => (ta, t);
7072
_ => (
7173
(_, t) = std-infer-expr(tctx, t, false, Used, TAny);
7274
(typeof(t), t);

0 commit comments

Comments
 (0)