Skip to content

fix: type checking check operators with because #1796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 19, 2025
Merged
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
22 changes: 17 additions & 5 deletions src/js/trove/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,31 @@
"current-checker": ["arrow", [], ["record", {
"run-checks": "tbot",
"check-is": "tbot",
"check-is-not": "tbot",
"check-is-cause": "tbot",
"check-is-roughly": "tbot",
"check-is-roughly-cause": "tbot",
"check-is-not": "tbot",
"check-is-not-cause": "tbot",
"check-is-refinement": "tbot",
"check-is-refinement-cause": "tbot",
"check-is-not-refinement": "tbot",
"check-satisfies": "tbot",
"check-is-not-refinement-cause": "tbot",
"check-satisfies": "tbot", // doesn't have -cause
"check-satisfies-not": "tbot", // doesn't have -cause
"check-satisfies-delayed": "tbot",
"check-satisfies-not": "tbot",
"check-satisfies-delayed-cause": "tbot",
"check-satisfies-not-delayed": "tbot",
"check-satisfies-not-delayed-cause": "tbot",
"check-raises-str": "tbot",
"check-raises-not": "tbot",
"check-raises-str-cause": "tbot",
"check-raises-other-str": "tbot",
"check-raises-other-str-cause": "tbot",
"check-raises-not": "tbot",
"check-raises-not-cause": "tbot",
"check-raises-satisfies": "tbot",
"check-raises-violates": "tbot"
"check-raises-satisfies-cause": "tbot",
"check-raises-violates": "tbot",
"check-raises-violates-cause": "tbot"
}]]
}],

Expand Down
File renamed without changes.
43 changes: 43 additions & 0 deletions tests/type-check/good/tests-because.arr
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
check:
fun less-than(l :: Number, r :: Number): l < r end
fun is-even(n :: Number): num-modulo(n, 2) == 0 end

67 is 67
67 is 67 because 67

~0.0000001 is-roughly ~0.0000002
~0.0000001 is-roughly ~0.0000002 because ~0.0000001

67 is-not 69
67 is-not 69 because 67

67 is%(less-than) 69
67 is%(less-than) 69 because 67

69 is-not%(less-than) 67
69 is-not%(less-than) 67 because 69

67 + 1 satisfies is-even
67 + 1 satisfies is-even because 68

70 - 1 violates is-even
70 - 1 violates is-even because 69

raise("err") raises "err"
raise("err") raises "err" because raise("err")

raise("foo") raises-other-than "bar"
raise("foo") raises-other-than "bar" because raise("foo")

67 does-not-raise
67 does-not-raise because 67

fun is-foo(x :: Any): x == "foo" end

raise("foo") raises-satisfies is-foo
raise("foo") raises-satisfies is-foo because raise("foo")

raise("bar") raises-violates is-foo
raise("bar") raises-violates is-foo because raise("bar")
end