Describe the bug
The following test currently succeeds:
|
test bool ADTWithTypeParameterAndKW3() = checkModuleOK(" |
|
module ADTWithTypeParameterAndKW3 |
|
data D[&T] = d1(&T n, &T kw = n); |
|
void f() { D[int] x = d1(10); str m = x.kw; } |
|
"); |
However, it should fail, because:
&T is bound to int;
- the type of
x.kw is int;
- the type of
m is str.
A preliminary investigation suggests that the req that compares the types of m and x.kw is triggered too early by the solver (when it hasn't established yet that &T is bound to int), possibly because of a missing dependency. Need to look into this in more detail.
To Reproduce
Run the test.
Expected behavior
The test should fail.
Describe the bug
The following test currently succeeds:
rascal/src/org/rascalmpl/compiler/lang/rascalcore/check/tests/DataDeclarationTCTests.rsc
Lines 487 to 491 in 22b7a02
However, it should fail, because:
&Tis bound toint;x.kwisint;misstr.A preliminary investigation suggests that the
reqthat compares the types ofmandx.kwis triggered too early by the solver (when it hasn't established yet that&Tis bound toint), possibly because of a missing dependency. Need to look into this in more detail.To Reproduce
Run the test.
Expected behavior
The test should fail.