You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In any comparison, the types of the two operands must unify or one of the operands must be null.
But that's not always the case in practice. For example, the following code is currently valid:
a: 1.0
b: int & 1
c: a == b
But this contradicts the spec, because a does not unify with b and neither operand is null.
For example this code:
a: 1.0
b: int & 1
c: a & b
gives this error:
c: conflicting values 1.0 and int (mismatched types float and int):
./x.cue:1:4
./x.cue:2:4
./x.cue:3:8
The spec should also state explicitly the rules for comparison against _|_, which clearly does not unify against anything except _|_ itself, but in fact appears to be comparable against anything in a similar fashion to null.
The text was updated successfully, but these errors were encountered:
In the spec, the documentation for comparison operators says:
But that's not always the case in practice. For example, the following code is currently valid:
But this contradicts the spec, because
a
does not unify withb
and neither operand is null.For example this code:
gives this error:
The spec should also state explicitly the rules for comparison against
_|_
, which clearly does not unify against anything except_|_
itself, but in fact appears to be comparable against anything in a similar fashion tonull
.The text was updated successfully, but these errors were encountered: