Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio Code's Java Compiler Not Showing Certain Errors #7

Closed
key6oardWarrior opened this issue Dec 4, 2019 · 0 comments
Closed

Comments

@key6oardWarrior
Copy link

key6oardWarrior commented Dec 4, 2019

When running Java code I have noticed that some compile time errors will not be displayed. For example, the following code should throw an error, "HashMap<Integer, Integer> hashMapName = new HashMap<Integer, String>();" Instead of seeing, "Unresolved compilation problems:
Type mismatch: cannot convert from HashMap<Integer,Integer> to HashMap<Integer,String>
The method put(Integer, String) in the type HashMap<Integer,String> is not applicable for the arguments (int, int)" The compiler displays, "Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at Test.main(Test.java:8)" If I want to see the error message then I have to read the class file in order to determin what the error is and where it is located. I was able to reproduce the bug in a small and simple Java file. I noticed that the bug shows up when I declare the 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 occors when dataTypeC is different from dataTypeA and or dataTypeD is differnt from dataTypeB.
@key6oardWarrior key6oardWarrior changed the title Visual Studio Code's Java Compiler Not Showing Errors Visual Studio Code's Java Compiler Not Showing Certain Errors Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant