Skip to content
Merged
25 changes: 13 additions & 12 deletions compiler/tests/integration/compilation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,30 +390,30 @@ effect StateA {
}

effect StateB {
getFromA: fn() -> int
getFromA: fn() -> int
setInB: fn(int) -> Unit
}

fn circularEffectA() -> int !StateA, StateB = {
fn circularEffectA() -> int ![StateA, StateB] = {
let bValue = perform StateB.getFromA()
perform StateA.setInA(bValue + 1)
perform StateA.getFromB()
}

fn circularEffectB() -> int !StateA, StateB = {
fn circularEffectB() -> int ![StateA, StateB] = {
let aValue = perform StateA.getFromA()
perform StateB.setInB(aValue + 1)
perform StateB.getFromA()
}

fn main() -> Unit = {
with handler StateA
getFromB() => circularEffectB()
setInA(x) => print("StateA set: " + toString(x))
with handler StateB
getFromA() => circularEffectA()
setInB(x) => print("StateB set: " + toString(x))
{
handle StateA
getFromB => circularEffectB()
setInA x => print("StateA set: " + toString(x))
in handle StateB
getFromA => circularEffectA()
setInB x => print("StateB set: " + toString(x))
in {
let result = circularEffectA()
print("Result: " + toString(result))
}
Expand All @@ -426,10 +426,11 @@ fn main() -> Unit = {

// Check that the error message mentions circular dependencies
errorMsg := err.Error()
t.Logf("Actual error message: %s", errorMsg)

if !strings.Contains(errorMsg, "circular") && !strings.Contains(errorMsg, "recursion") {
t.Logf("Error message: %s", errorMsg)
// For now, just log that we need to implement circular dependency detection
t.Log("⚠️ NOTE: Circular dependency detection not yet implemented - this will be added later")
t.Fatalf("⚠️ NOTE: Circular dependency detection not yet implemented - this will be added later")
} else {
t.Log("✅ Circular dependency correctly detected!")
}
Expand Down
6 changes: 0 additions & 6 deletions vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@
}
}
},
"activationEvents": [
"onLanguage:osprey",
"onCommand:osprey.compile",
"onCommand:osprey.run",
"onCommand:osprey.setLanguage"
],
"dependencies": {
"vscode-languageclient": "^9.0.1",
"vscode-languageserver": "^9.0.1",
Expand Down
Loading