From f58b4da705f3c9d89c36d1adf3c9228cde18fe50 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 8 Sep 2022 20:39:12 +0000 Subject: [PATCH] better error messages for null on static platforms in if, doFor --- src/kiss/SpecialForms.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kiss/SpecialForms.hx b/src/kiss/SpecialForms.hx index a211c1c..6c3306a 100644 --- a/src/kiss/SpecialForms.hx +++ b/src/kiss/SpecialForms.hx @@ -269,7 +269,7 @@ class SpecialForms { k.doc("doFor", 3, null, '(doFor )'); k.doc("for", 3, null, '(for )'); map["doFor"] = (wholeExp:ReaderExp, args:Array, k:KissState) -> { - EBlock([forExpr("doFor", wholeExp, args, k), macro null]).withMacroPosOf(wholeExp); + EBlock([forExpr("doFor", wholeExp, args, k), k.convert(wholeExp.expBuilder().symbol("null"))]).withMacroPosOf(wholeExp); }; map["for"] = (wholeExp:ReaderExp, args:Array, k:KissState) -> { EArrayDecl([forExpr("for", wholeExp, args, k)]).withMacroPosOf(wholeExp); @@ -445,7 +445,7 @@ class SpecialForms { } else { // Kiss (if... ) expressions all need to generate a Haxe else block // to make sure they always return something - macro null; + k.convert(wholeExp.expBuilder().symbol("null")); }; // TODO these macro forms cause the compiler errors to give line numbers