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

Bug 332795

Summary: [compiler][generics] import issues with inherited playedBy binding inside parameterized team
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.8   
Target Milestone: 0.8 M5   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test & fix none

Description Stephan Herrmann CLA 2010-12-16 16:02:36 EST
given these teams:

import pack.MyBase;
public team class SuperTeam<U> {
    protected class R playedBy MyBase {}
}

public team class SubTeam extends SuperTeam<String> {
    @Override
    protected class R {}
}

Here the compiler complains at SubTeam.R that MyBase cannot be resolved.
When adding an explicit import for MyBase
- that import is marked as unused
- the bogus error disappears
- a warning appears that MyBase should be imported using a base import
  (which in turn wouldn't work).

The problem does go away if SuperTeam uses a base import as recommended.
(SuperTeam did have a 'bindingconventions' warning in the first place).
Comment 1 Stephan Herrmann CLA 2011-01-26 18:42:32 EST
Created attachment 187701 [details]
test & fix

Apparently some alien scope type references were simply missing
a roll back after first resolve attempt failed.
Comment 2 Stephan Herrmann CLA 2011-01-26 18:44:43 EST
Patch has been committed as r1251, r1252.
Comment 3 Stephan Herrmann CLA 2011-01-29 13:41:21 EST
The main issues has been verified for 0.8M5 using build 201101290806.

Filed a FUP as bug 335774.