From a064a87ecdfefeb600830f6add026da55e1758c4 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Fri, 7 Feb 2025 17:17:02 -0500 Subject: [PATCH] lang: Add a weird test case Mark Smith was concerned we might not handle this case correctly. It seems we do in fact catch this scenario, so it's not an issue. Yay! --- lang/interpret_test/TestAstFunc2/ycombinator.txtar | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lang/interpret_test/TestAstFunc2/ycombinator.txtar diff --git a/lang/interpret_test/TestAstFunc2/ycombinator.txtar b/lang/interpret_test/TestAstFunc2/ycombinator.txtar new file mode 100644 index 00000000..43c7cd7c --- /dev/null +++ b/lang/interpret_test/TestAstFunc2/ycombinator.txtar @@ -0,0 +1,14 @@ +-- main.mcl -- +import "fmt" + +$y = func($fn) { + $fn($fn) +}( + func($fn) { + $fn($fn) + } +) + +test [fmt.printf("y: %v", $y),] {} +-- OUTPUT -- +# err: errUnify: unify error with: param(fn): directly in the same set