Describe the bug
The following test mistakenly fails (i.e., the typechecker reports a type error, but the program is well-typed):
test bool falsePositive() = checkModuleOK("
module FalsePositive /**/
data D[&T] = d(&T n);
int f() {
n1 = d(5).n;
n2 = n1;
n3 = n2;
return n3 + 5;
}
");
// Typechecker reports type error: "Addition not defined on `&T` and `int`"
The " /**/" is needed to force Typepal to schedule calcs/reqs in a particular order. Without it, the test succeeds.
To Reproduce
Run the test. See also: #2869.
Expected behavior
The test should succeed.
Describe the bug
The following test mistakenly fails (i.e., the typechecker reports a type error, but the program is well-typed):
The "
/**/" is needed to force Typepal to schedule calcs/reqs in a particular order. Without it, the test succeeds.To Reproduce
Run the test. See also: #2869.
Expected behavior
The test should succeed.