Fix Algebraic Effects Circular Dependency Test #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TLDR
Changed the circular dependency test from logging a warning (
t.Log) to failing hard (t.Fatalf) when circular dependencies aren't detected, following the project's "NO PLACEHOLDERS" principle. Also fixed invalid Osprey syntax in the test code that was preventing the circular dependency detector from running.What Was Added?
TestFailsCompilationCircularDependencyto always show the actual error message receivedWhat Was Changed / Deleted?
Changed Files:
compiler/tests/integration/compilation_test.go:t.Log()tot.Fatalf()when circular dependency detection fails (line 432)!StateA, StateB→with handler StateA→handle StateA ... in(corrected handler syntax)getFromB()→getFromB(removed invalid parentheses from handler operation names)setInA(x)→setInA x(corrected handler parameter syntax)vscode-extension/package.json:activationEventssection (6 lines) - VS Code now automatically activates based oncontributessectionHow Do The Automated Tests Prove It Works?
Test:
TestFailsCompilationCircularDependencyCompiles code with circular effect handlers:
Verifies compilation fails (line 423-424)
Checks error message contains "circular" or "recursion" (line 431-433)
t.Log()- test passed even when detection didn't workt.Fatalf()- test fails hard if detection doesn't workResult: Test now properly validates that the compiler's circular dependency detection (implemented in
internal/codegen/effects_generation.go:537-586) catches this pattern and reports:All existing tests pass, confirming no regressions introduced.
Summarise Changes To The Spec Here
No spec changes required.
The circular dependency detection was already fully implemented and documented in
/workspace/compiler/spec/0017-AlgebraicEffects.md. This PR only fixes the test to properly exercise and validate the existing implementation.