Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311329 - [inline] Inline method drops implicitly used method type argument (Foo.<This>bar())
Summary: [inline] Inline method drops implicitly used method type argument (Foo.<This>...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-02 22:20 EDT by Chris West (Faux) CLA
Modified: 2020-03-08 17:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris West (Faux) CLA 2010-05-02 22:20:54 EDT
Build Identifier: I20100413-1521

With a class such as the following, where "first" only implicitly references the static generic parameter, inlining will lose references to the parameter entirely.

class Scratch {
  static <U> List<U> second() {
    return new ArrayList<U>();
  }

  static <T> List<T> first() {
    return second();
  }

  void client() {
    use(Scratch.<String>first());
  }

  static void use(List<String> emptyList) {}
}

Inlining "first" results in "client" attempting to call "use(Scratch.second());", which is a compile error.

"use(Scratch.<String>second());" is expected / required.


Reproducible: Always

Steps to Reproduce:
1. Open the above class in a Java editor; fix the imports.
2. Place the cursor inside the "first" declaration.
3. Inline (alt+shift+i / alt+shift+t,&Inline..)
4. Observe compile error.
Comment 1 Dani Megert CLA 2010-05-03 00:16:10 EDT
There since at least 3.2. Nothing in the .log.
Comment 2 Eclipse Genie CLA 2020-03-08 17:04:00 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.