You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running Java code I have noticed that certain compile time errors will not be displayed.
Environment
Operating System: Windows 10
JDK version: 11.0.4.11
Visual Studio Code version: 1.40.2
Java extension version: 0.8.1
Java Debugger extension version: 0.23.0
Steps To Reproduce
Declare the HashMap like, HashMap<dataTypeA, dataTypeB> name = new HashMap<dataTypeC, dataTypeD>();
Where dataType A - D could be any data type I want it to be.
The bug only occurs when dataTypeC is different from dataTypeA and or dataTypeD is different from dataTypeB.
Current Result
The compiler displays,
`Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at Test.main(Test.java:10)`
Expected Result
The compiler should display, Unresolved compilation problems: Type mismatch: cannot convert from HashMap<dataTypeA,dataTypeB> to HashMap<dataTypeC,dataTypeD> The method put(dataTypeA,dataTypeB) in the type HashMap<dataTypeC,dataTypeD> is not applicable for the arguments (dataTypeA,dataTypeB)
Additional Informations
If I want to see the error message then I have to read the class file in order to determine what the error is and what line it is on. The bug will only occur if the data structure is declared as a class member. I have been able to reproduce this bug with other data structures such as ArrayList, 1D list, and 2D list.
The text was updated successfully, but these errors were encountered:
Description of the Issue
When running Java code I have noticed that certain compile time errors will not be displayed.
Environment
Steps To Reproduce
Declare the HashMap like,
HashMap<dataTypeA, dataTypeB> name = new HashMap<dataTypeC, dataTypeD>();
Where dataType A - D could be any data type I want it to be.
The bug only occurs when dataTypeC is different from dataTypeA and or dataTypeD is different from dataTypeB.
Current Result
The compiler displays,
`Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Expected Result
The compiler should display,
Unresolved compilation problems: Type mismatch: cannot convert from HashMap<dataTypeA,dataTypeB> to HashMap<dataTypeC,dataTypeD> The method put(dataTypeA,dataTypeB) in the type HashMap<dataTypeC,dataTypeD> is not applicable for the arguments (dataTypeA,dataTypeB)
Additional Informations
If I want to see the error message then I have to read the class file in order to determine what the error is and what line it is on. The bug will only occur if the data structure is declared as a class member. I have been able to reproduce this bug with other data structures such as ArrayList, 1D list, and 2D list.
The text was updated successfully, but these errors were encountered: