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

Bug 331869

Summary: [compiler][generics] static role method cannot access type variable of the enclosing 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 M4   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test & fix none

Description Stephan Herrmann CLA 2010-12-05 10:35:57 EST
Consider this snippet:

public team class MyTeam<E> {
    protected class R {
        static void test(E e) {}
    }
}

Here the compiler complains that it cannot access the non-static type E
from a static context. However, in contrast to Java we support static
methods in non-static member types, so staticness does not apply when
looking at MyTeam.
Comment 1 Stephan Herrmann CLA 2010-12-05 10:40:30 EST
Created attachment 184556 [details]
test & fix

Fixed by using the same strategy we already used in 
Scope.getBinding(char[],int,InvocationSite,boolean)
and applying it also to internalGetTypeOrPackage()
Comment 2 Stephan Herrmann CLA 2010-12-05 10:41:33 EST
Patch has been committed as r1132 f.
Comment 3 Stephan Herrmann CLA 2010-12-16 15:35:03 EST
Verified for M4 using build 201012150343