Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 560999

Summary: var with generic is allowed
Product: [Eclipse Project] JDT Reporter: Joja Joja <jojaa350>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED MOVED QA Contact:
Severity: normal    
Priority: P3 CC: srikanth.sankaran
Version: 4.14   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Joja Joja CLA 2020-03-10 18:05:40 EDT
It's valid to use a generic type with the var keyword, which should not be allowed:

var<Integer> a = new ArrayList<Double>();
var<Integer> b = new ArrayList<>();
var<> c = new ArrayList<>();

The generic type does have no effect and seems to be ignored completely. These programs are compiled and executed perfectly fine.
Comment 1 Eclipse Genie CLA 2022-03-02 12:15:41 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Srikanth Sankaran CLA 2023-06-01 03:53:15 EDT
Same as https://github.com/eclipse-jdt/eclipse.jdt.core/issues/600