Skip to content

Commit a68ebee

Browse files
mbouazizclaude
andcommitted
Fix AllowTrackedCall test: make it self-contained with untracked lambda
The test was referencing Unsafe.unsafe_untracked_call from the prelude, but test .sk files are compiled standalone. Define @allow_tracked_call locally and use `untracked () -> ...` lambda syntax. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent b120dcf commit a68ebee

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

skiplang/compiler/tests/Typechecking/AllowTrackedCall.sk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
module TypecheckingAllowTrackedCall;
22
// @allow_tracked_call lets a tracked function call an untracked function
33

4+
@allow_tracked_call
5+
untracked fun unsafeUntrackedCall<T>(f: untracked () -> T): T {
6+
f()
7+
}
8+
49
untracked fun sideEffect(): String {
510
"OK"
611
}
712

813
// This function is tracked (default), but can call sideEffect()
9-
// via Unsafe.unsafe_untracked_call
14+
// via unsafeUntrackedCall which has @allow_tracked_call
1015
fun trackedCaller(): String {
11-
Unsafe.unsafe_untracked_call(() -> sideEffect())
16+
unsafeUntrackedCall(untracked () -> sideEffect())
1217
}
1318

1419
untracked fun main(): void {

0 commit comments

Comments
 (0)