Open theosotr opened 1 month ago
Thanks for the report! I can reproduce the problem.
public class Test {
public static <T> T m(T x) { return x; }
public static void main(String[] args) {
String p2 = null;
var x = m(p2);
String y = x;
y.replace("", "");
}
}
produces no warning. Changing the type of x
from var
to the supposedly equal String
gives the expected warning.
As you didn't file this issue with typetools, I assume that it was fixed in a release we haven't pulled into eisop yet. We'll verify this before working on a fix.
Yes, you are right! It seems it has been fixed in typetools, because typetools 3.42.0 fails to identify the error, but typetoools 3.47.0 detects it! Next time, I will proceed with this verification step before opening an issue here. Thanks
Command
Program
Actual behavior
The code passes the checks, but I get NPE at runtime
Expected behavior
The code should have been rejected.