# HG changeset patch # User Simon Heath # Date 1727881630 14400 # Wed Oct 02 11:07:10 2024 -0400 # Branch devel # Node ID 5fcd87db0f64ecb672cb72a4e08d5b5ff9322d66 # Parent 5628fd649ef819d51f16c4d49fdfb3b9403c8d9e Okay I have narrowed my screwy instantiation bug down And now have a minimal test case in test_lambda7.gt. It looks like one of those things that is hard to find but easy to fix. Maybe we should do our tck.instances.insert() and tck.instances_rev.insert() inside tck.instantiate() ??? diff --git a/tests/programs/test_lambda6.gt b/tests/programs/test_lambda6.gt --- a/tests/programs/test_lambda6.gt +++ b/tests/programs/test_lambda6.gt @@ -17,15 +17,17 @@ end --- fn id(|T| val T) T = val end +fn id(|T| val T) T = val end fn main() {} = let f1 fn(Bool) Bool = fn(val Bool) Bool = val end let f2 fn(Bool) I32 = fn(val Bool) I32 = 4 end - let f3 = fn(|T| val T) T = val end + -- let f3 = fn(|T| val T) T = val end + -- let _thing = f3(false) + let _thing = id(false) let a1 Bool = apply1(f1, true) let a2 Bool = apply2(f1, true) - let a3 Bool = apply1(f3, true) + -- let a3 Bool = apply1(f3, true) -- let b I32 = apply(f2, true) -- let c Bool = apply1(id, true) -- let d I32 = apply(id, 3) diff --git a/tests/programs/test_lambda7.gt b/tests/programs/test_lambda7.gt new file mode 100644 --- /dev/null +++ b/tests/programs/test_lambda7.gt @@ -0,0 +1,24 @@ +-- Format: +-- status: success +-- Compile: +-- status: success +-- Run: +-- status: success +-- stdout: +-- false +-- true + + +fn id(|T| val T) T = val end + +fn main() {} = + -- BUGGO FIXME + -- Ok so this typechecks just fine... + let thing1 = id(false) + __println_bool(thing1) + + -- And this typechecks but does not generate instance info properly... + -- let f = fn(|T| val T) T = val end + -- let thing2 = f(true) + -- __println_bool(thing2) +end