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 #726

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

Comments

@key6oardWarrior
Copy link

key6oardWarrior commented Dec 6, 2019

Description of the Issue

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
  1. 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.

  2. 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.

VSCodeBugReport

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