| Summary: | [10] Extracting methods should infer `var` parameters' type | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Fred Bricon <fbricon> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jarthana, noopur_gupta |
| Version: | 4.8 | ||
| Target Milestone: | 4.9 M2 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Most likely belongs in the JDT/UI. Will take a look. See bug 535638 comment #1. *** This bug has been marked as a duplicate of bug 535638 *** |
Given a Java 10 project with public static void main(String[] args) { var foo = "String"; System.err.println(foo); } extracting "System.err.println(foo);" to a method ultimately produces public static void main(String[] args) { var foo = "String"; log(foo); } private static void log(var foo) { System.err.println(foo); } the intermediary wizard allows you to edit the foo parameter name, not the type. The type should be inferred as String in this case.