1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-01 00:04:58 +03:00
juvix/tests/negative/IncomparablePrecedences.juvix
Łukasz Czajka 8095e52c21
Check for incomparable precedences (#2289)
Give an error when there are two operators with incomparable precedences
instead of linearising the ordering arbitrarily.
2023-08-16 16:33:29 +02:00

20 lines
379 B
Plaintext

module IncomparablePrecedences;
type Bool := true | false;
syntax fixity log1 {arity: binary, assoc: left};
syntax fixity log2 {arity: binary, assoc: right};
syntax operator && log1;
syntax operator || log2;
&& : Bool -> Bool -> Bool
| true x := x
| false _ := false;
|| : Bool -> Bool -> Bool
| true _ := true
| false x := x;
main : Bool := false && true || true;