Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions compiler/analysis/typechecker.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- **Effect tags now cover every clause of a function.** `@pure`, `@no_fs`,
`@no_net`, and `@no_os` no longer accept a function when a later pattern
clause, or a later clause of a transitive callee, reaches a forbidden
capability.
7 changes: 7 additions & 0 deletions tests/integration/effect_tags/reject_multiclause.ae
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import std.os

@no_os
status(0) -> 0
status(n: int) -> os.system("echo hi") + n

main() { status(1) }
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import std.os

helper(0) -> 0
helper(n: int) -> os.system("echo hi") + n

@pure
run() -> helper(1)

main() { run() }
4 changes: 3 additions & 1 deletion tests/integration/effect_tags/test_effect_tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ check_rejected() {
check_rejected reject_fs fs
check_rejected reject_transitive os
check_rejected reject_net net
check_rejected reject_multiclause os
check_rejected reject_multiclause_transitive os

echo " [PASS] effect_tags: @no_fs / @pure-transitive / @no_net violations all rejected"
echo " [PASS] effect_tags: direct, transitive, and multi-clause violations all rejected"
exit 0