Skip to content

Commit 54e8813

Browse files
committed
retain / release divergence fixed, but not counting yet
1 parent ef77f10 commit 54e8813

4 files changed

Lines changed: 8 additions & 26 deletions

File tree

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ LSTSFLAGS = MALLOC_CHECK_=3
88
# recommendation: ulimit -s unlimited
99

1010
dev: install-production
11-
#lm --v3 tests/promises/meta/generic-retain-release.lsts > out.txt
12-
lm --v3 tests/promises/meta/fields-of.lsts
11+
lm --v3 tests/promises/meta/generic-retain-release.lsts > out.txt
1312
gcc tmp.c
14-
./a.out
15-
lm --v3 tests/promises/meta/cases-of.lsts
16-
gcc tmp.c
17-
./a.out
13+
#./a.out
1814

1915
build: compile-production
2016
time env $(LSTSFLAGS) ./production --v3 -o deploy1.c SRC/index.lsts

PLUGINS/BACKEND/C/std-c-compile-expr.lsts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -231,23 +231,6 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
231231
App{ is-cons=is-cons, left=left, right=right } => (
232232
if not(is-cons) and typeof-term(left).is-arrow {
233233
match left {
234-
Var{fname1=key:c"<:"} => (
235-
match right {
236-
App{ lt=left, rt=right } => (
237-
let lt-tt = typeof-term(lt);
238-
let rt-tt = typeof-term(rt);
239-
if lt-tt.is-t(c"Type",1) and rt-tt.is-t(c"Type",1)
240-
then (
241-
let lt-val = denormalize(lt-tt.slot(c"Type",1).l1);
242-
let rt-val = denormalize(rt-tt.slot(c"Type",1).l1);
243-
if can-unify( rt-val, lt-val )
244-
then mk-expression(c"1")
245-
else mk-expression(c"0")
246-
) else std-c-compile-call(ctx, fname1, right);
247-
);
248-
_ => std-c-compile-call(ctx, fname1, right);
249-
}
250-
);
251234
Var{fname2=key:c".into"} => (
252235
match right {
253236
App{ lt=left, rt=right } => (

SRC/typecheck-infer-expr.lsts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,11 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
190190
App{left:App{ left:App{ ifv=left:Var{key:c"if"}, cond=right }, t=right }, f=right} => (
191191
let short-circuit = ASTEOF;
192192
match cond {
193-
App{ left:Var{key:c"<:"}, right:App{left:AType{lt=tt},right:AType{rt=tt}} } => (
194-
lt = denormalize-strong(lt.slot(c"Type",1).l1);
195-
rt = denormalize-strong(rt.slot(c"Type",1).l1);
193+
App{ left:Var{key:c"<:"}, right:App{short-left=left, short-right=right} } => (
194+
(tctx, short-left) = std-infer-expr(tctx, short-left, false, Used, ta);
195+
(tctx, short-right) = std-infer-expr(tctx, short-right, false, Used, ta);
196+
let lt = denormalize-strong(typeof-term(short-left).slot(c"Type",1).l1);
197+
let rt = denormalize-strong(typeof-term(short-right).slot(c"Type",1).l1);
196198
if non-zero(lt) and non-zero(rt) {
197199
if can-unify(rt, lt) {
198200
(tctx, short-circuit) = std-infer-expr(tctx, t, false, Tail, ta);

lib/core/phi.lsts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ let .release(x: xt): Nil = (
6060
};
6161
};
6262
};
63+
mark-as-released(x);
6364
);

0 commit comments

Comments
 (0)