Conversation
|
Personally, I couldn't find the adequate method call to fix this bug the other way around, as the already used method seems like it should work. |
|
My ¥0.02: This solution should fix the problem (for Latte). Generics in Java are optional, so they do not have a real identity. For Latte this is fine. For LJ this is more troublesome: you might want to specify LinkedList<@refined(“x>0”) Integer>. But I am afraid the syntax won’t work, and it will be inconsistent with the usage of raw types. |
|
Yeah, I agree, this fixes the problem for now, so we can merge it 🚀 |
CatarinaGamboa
left a comment
There was a problem hiding this comment.
You can squash and merge @Pichers 🚀
Description
Changed how class types are searched in the ClassLevelMaps to be coherent with how they are registered.
Example
A Class type would be added by the method VisitCtClass(...) in LatteClassFirstPass as "LinkedList",
but would be searched for by the method visitCtInvocation(...) in LatteTypeChecker as "LinkedList<String>" (for example), leading to a miss.
Was fixed by using .getTypeErasure() on visitCtInvocation(...), simplifying to "LinkedList" in every case
Related Issue
Closes #6
Type of change
How Has This Been Tested?
App.java was run and the previously known bug was found.
Adding other instances of the same class but with different Types did not affect the correctness of the output.