History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEABKL-3607
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Eugene Vigdorchik
Reporter: Keith Lea
Votes: 0
Watchers: 0
Available Workflow Actions

Mark as Stalled
Operations

If you were logged in you would be able to see more operations.
IDEA: Backlog

"Create field" within method generates bad code when the inferred type references a method type parameter

Created: 03 Apr 06 22:22   Updated: 04 Apr 06 00:26
Component/s: Editor. Intention Actions
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 4,167
Severity: Medium


 Description  « Hide
class Tester {
  <E> void method() {
    Set<E> x;
    list.add(x);
  }

Alt+Enter on use of nonexistent variable "list", choose "Create field", you see:

=
class Tester {
  private Set<Set<E>> list;

  <E> void method() {
    Set<E> x;
    list.add(x);
  }
}

The correct behavior would be to use Set<Set<?>>.



 All   Comments   Work Log   Change History      Sort Order:
Eugene Vigdorchik - 04 Apr 06 00:25
In general more sophisticated analysis is needed to get the type for 'E' depending on the variance of the context x is used.