@@ -18,7 +18,7 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
1818 if not(is(rhs,new-rhs)) then { rhs = new-rhs; term = mk-app(mk-abs(def,mk-nil(),misc-tt),rhs); };
1919 (tctx, let tt) = std-bind-term(tctx, lname, rhs, def, term, hint);
2020 tctx = tctx.ascript(def, tt);
21- tctx = tctx.ascript(term, t0(c"Nil") );
21+ tctx = tctx.ascript(term, type-nil );
2222 );
2323 App{o-t=left:Var{key:c"typeof"}, r=right} => (
2424 (tctx, let new-r) = std-infer-expr(tctx, r, is-scoped, Used, ta);
@@ -63,7 +63,7 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
6363 App{asc=left:Lit{key:c":"}, right:App{inner=left:ASTNil{},right:AType{tt=tt}}} => (
6464 tt = tt.rewrite-type-alias;
6565 add-concrete-type-instance(tt, term);
66- tctx = tctx.ascript(inner, t0(c"Nil") );
66+ tctx = tctx.ascript(inner, type-nil );
6767 tctx = tctx.ascript(term, tt);
6868 );
6969 App{asc=left:Lit{key:c":"}, right:App{t=left,right:AType{tt=tt}}} => (
@@ -88,7 +88,7 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
8888 let is-nullary = false;
8989 if typeof-term(t).is-arrow and not(tt.is-arrow) and non-zero(var-name-if-var-or-lit(t)) {
9090 # This case exists for nullary constructors like TAny : Type
91- let ftype = tctx.find-callable( var-name-if-var-or-lit(t), t0(c"Nil") , term, tt ).direct-type;
91+ let ftype = tctx.find-callable( var-name-if-var-or-lit(t), type-nil , term, tt ).direct-type;
9292 tctx = tctx.ascript(term, ftype);
9393 is-nullary = true;
9494 } else if typeof-term(t) == type-any-arrow {
@@ -175,7 +175,7 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
175175 };
176176 let lub = if typeof-term(f).is-t(c"Never",0) then typeof-term(t)
177177 else if typeof-term(t).is-t(c"Never",0) then typeof-term(f)
178- else if typeof-term(f).is-t(c"Nil",0) or typeof-term(t).is-t(c"Nil",0) then t0(c"Nil")
178+ else if typeof-term(f).is-t(c"Nil",0) or typeof-term(t).is-t(c"Nil",0) then type-nil
179179 else { (tctx, let lub) = tctx.least-upper-bound(typeof-term(t), typeof-term(f), term); lub };
180180 tctx = tctx.ascript(term, lub);
181181 let term-phi-id = typeof-term(term).slot(c"Phi::Id",1).l1.simple-id;
@@ -189,9 +189,9 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
189189 if non-zero(term-phi-id) and term-phi-id != f-phi-id then tctx = tctx.phi-move(typeof-term(f), f);
190190 }
191191 );
192- ASTEOF{} => tctx = tctx.ascript(term, t0(c"Nil") );
193- ASTNil{} => tctx = tctx.ascript(term, t0(c"Nil") );
194- Meta{} => tctx = tctx.ascript(term, t0(c"Nil") );
192+ ASTEOF{} => tctx = tctx.ascript(term, type-nil );
193+ ASTNil{} => tctx = tctx.ascript(term, type-nil );
194+ Meta{} => tctx = tctx.ascript(term, type-nil );
195195 Typedef{} => ();
196196 AType{tt:TGround{tag:c"Type",parameters:[p1..]}} => tctx = tctx.ascript(term, t1(c"Type",p1.sanitize-phi));
197197 AType{tt=tt} => tctx = tctx.ascript(term, tt.sanitize-phi);
@@ -274,7 +274,7 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
274274 } else if not(non-zero(typeof-term(term))) {
275275 if hint.is-t(c"HashtableEq",2) and hint.is-datatype and key3==c"HashtableEqEOF"
276276 then {
277- (tctx, let lit-tt) = tctx.apply-callable(key3, t0(c"Nil") , term, hint);
277+ (tctx, let lit-tt) = tctx.apply-callable(key3, type-nil , term, hint);
278278 tctx = tctx.ascript(term, lit-tt);
279279 } else {
280280 tctx = tctx.ascript(term, type-any-arrow);
@@ -340,7 +340,7 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
340340 let pre-retain-tctx = tctx;
341341 (tctx, let new-r) = std-infer-call-arg(tctx, r, var-name-if-var-or-lit(l), rr-args-hint);
342342 let ftype = tctx.find-callable( var-name-if-var-or-lit(l), typeof-term(new-r), term, direct-hint ).direct-type;
343- if typeof-term(l) == t2(c"Arrow",t0(c"Any"),t0(c"Any")) {
343+ if typeof-term(l) == type-any-arrow {
344344 tctx = tctx.ascript(l, ftype);
345345 };
346346 if ftype.domain.is-any-arg-t(c"MustNotRetain",0) {
@@ -398,16 +398,16 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
398398 let tmp-var = mk-var(tmp-id); ascript-force(tmp-var, typeof-term(term));
399399 tctx = tctx.bind(tmp-id, ta, typeof-term(term), tmp-def);
400400 mark-var-to-def-todo(tctx, tmp-id, ta, tmp-var);
401- let tmp-nil = mk-nil(); ascript-force(tmp-nil, t0(c"Nil") );
402- let declare = mk-abs(tmp-def, tmp-nil, ta); ascript-force(declare, t0(c"Nil") );
401+ let tmp-nil = mk-nil(); ascript-force(tmp-nil, type-nil );
402+ let declare = mk-abs(tmp-def, tmp-nil, ta); ascript-force(declare, type-nil );
403403 if function-type.is-t(c"MustRetainOnCall",0) and not(hint.is-t(c"MustNotRetain",0)) and not(tctx.get-or(mk-tctx()).is-blob) {
404404 (tctx, term) = maybe-retain(tctx, term);
405405 };
406- let bind = mk-app(declare, term); ascript-force(bind, t0(c"Nil") );
406+ let bind = mk-app(declare, term); ascript-force(bind, type-nil );
407407
408408 let new-term = bind;
409409 if non-zero(prefix) {
410- new-term = mk-cons(prefix, new-term); ascript-force(new-term, t0(c"Nil") );
410+ new-term = mk-cons(prefix, new-term); ascript-force(new-term, type-nil );
411411 };
412412 new-term = mk-cons(new-term, postfix); ascript-force(new-term, typeof-term(postfix));
413413 new-term = mk-cons(new-term, tmp-var); ascript-force(new-term, typeof-term(term));
0 commit comments