-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
Description
Describe the bug
Equality depends in some cases on the declared type of the operands. This leads to unexpected and asymmetric results.
To Reproduce
The following cases do work as expected:
rascal>value x = 5;
value: 5
rascal>x == 5;
bool: truerascal>value y = [5, 6, 7];
value: [5,6,7]
rascal>y == [5, 6, 7];
bool: truerascal>z1 = indexOf;
int (list[&T], &T): function(|std:///List.rsc|(5352,518,<210,0>,<229,1>))
rascal>z1 == indexOf;
bool: trueThe following cases don't work as expected (HT: @rodinaarssen):
rascal>value z2 = indexOf;
value: function(|std:///List.rsc|(5352,518,<210,0>,<229,1>))
rascal>z2 == indexOf;
bool: false
rascal>indexOf == z2;
bool: falserascal>syntax S = "s";
ok
rascal>S ss = (S)`s`;
S: (S) `s`
rascal>value vv = ss;
value: appl(
prod(
sort("S"),
[lit("s")],
{}),
[appl(
prod(
lit("s"),
[\char-class([range(115,115)])],
{}),
[char(115)])],
src=|prompt:///|(11,1))
rascal>ss == vv
bool: false
rascal>vv == ss
bool: true