E0050: unknown_checker_predicate
E0050 unknown_checker_predicate — a checker rule names a predicate nothing implements.
A compile-time error of soma check, the checker of the Soma programming language (soma explain E0050).
The rule
A require in a cell checker rule must name one of the structural predicates: all_persistent, all_encrypted, all_consistent, has_memory, has_face, has_signals, has_auth. An unknown predicate would make the rule hold for every cell (or fail every cell under !), so the checker would enforce nothing. Fix the predicate name; the message suggests the closest one.
A program that triggers it
wrong.cell
cell checker durable_storage {
face {
promise "every cell keeps its data across restarts"
}
rules {
check {
require all_persisted else NotPersistent
}
}
}
cell Accounts {
face {
signal open(owner: String) -> String
}
memory {
owners: Map<String, String> [persistent]
}
on open(owner: String) {
owners.set(owner, "open")
return owner
}
}What soma check prints:
$ soma check wrong.cell
error: checker 'durable_storage' requires 'all_persisted' (did you mean 'all_persistent'?), which nothing implements — the rule would hold for every cell (and fail every cell under `!`). The predicates are: all_persistent, all_encrypted, all_consistent, has_memory, has_face, has_signals, has_auth
--> wrong.cell:7:21
|
7 | require all_persisted else NotPersistent
| ^
= code: E0050
✗ 1 error(s), 0 warning(s).The fix field of soma check --json: the rule would hold for every cell (and fail every cell under `!`). The predicates are: all_persistent, all_encrypted, all_consistent, has_memory, has_face, has_signals, has_auth
The fix
On line 7, require all_persisted else NotPersistent becomes require all_persistent else NotPersistent.
wrong.cell → right.cell
--- wrong.cell
+++ right.cell
@@ -5,5 +5,5 @@
rules {
check {
- require all_persisted else NotPersistent
+ require all_persistent else NotPersistent
}
}With the fix, soma check accepts the program:
$ soma check right.cell
✓ All checks passed.