Describe the bug
In some cases, erroneous usage of undefined type parameters is reported (as expected). In other cases, it isn't. When it isn't, in some cases, errors downstream are reported. In other cases, they aren't.
To Reproduce
// -- Expected behavior --
alias List1[&T1] = list[&U1]; // Error
// -- Unexpected behavior --
alias List2 = list[&U2]; // No error
alias List3[&T3 <: &U3] = list[&U3]; // No error
alias List4[&T1] = list[&U3]; // No error. Moreover, "Go To Definition" suggests the def location of `&U3` (not a typo) is the location of the upper bound of `List3`.
List2[node] f2() {
List2 l = [];
l += 5; // No error
l += "foo"; // No error
l += [5]; // No error
l += ["foo"]; // No error
l += [5, "foo"]; // No error
int i = l[0]; // No error
str s = l[1]; // No error
return l;
}
List3[node] f3() {
List3[bool] l = [];
l += 5; // Error
l += "foo"; // Error
l += [5]; // Error
l += ["foo"]; // Error
l += [5, "foo"]; // No error
int i = l[0]; // No error
str s = l[1]; // No error
return l;
}
Expected behavior
- Errors in the definitions of
List2, List3, and List4.
- The def location of
&U3 in the definition of List4 cannot be the location of the upper bound of List3.
- In the definition of
f3, either for each addition to l an error, or for none.
- In the definition of
f3, errors in the assignments to i and s (i.e., it seems never safe to use those values as int and str without additional checks).
- The same errors in the definition of
f2 as in the definition of f3 (?)
Additional context
VS Code extension: 0.13.5
Describe the bug
In some cases, erroneous usage of undefined type parameters is reported (as expected). In other cases, it isn't. When it isn't, in some cases, errors downstream are reported. In other cases, they aren't.
To Reproduce
Expected behavior
List2,List3, andList4.&U3in the definition ofList4cannot be the location of the upper bound ofList3.f3, either for each addition tolan error, or for none.f3, errors in the assignments toiands(i.e., it seems never safe to use those values asintandstrwithout additional checks).f2as in the definition off3(?)Additional context
VS Code extension: 0.13.5