From b3fd91158524dac377ddb756f44f8e3fe67d9cea Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 7 Aug 2022 18:43:54 +0200 Subject: allow def inside aggregate --- bootstrap/test2.cff | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bootstrap/test2.cff') diff --git a/bootstrap/test2.cff b/bootstrap/test2.cff index 356312c..3061d6e 100644 --- a/bootstrap/test2.cff +++ b/bootstrap/test2.cff @@ -11,8 +11,9 @@ struct Node { def X = 7 + 2; struct Bit { - fn neg(x T) T { return ~x + X; } - !fn neg(x T) T { return ~x + Y; } + def Z = 3; + fn foo(x T) T { return (~x ^ Z) + X; } + !fn foo(x T) T { return ~x + Y; } } def Y = 3.3; @@ -31,6 +32,6 @@ extern fn main() void { n->ok(); x->ok(); - Bit:neg(3); - Bit:neg(3); + Bit:foo(3); + Bit:foo(3); } -- cgit v1.2.3