Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331869 - [compiler][generics] static role method cannot access type variable of the enclosing team
Summary: [compiler][generics] static role method cannot access type variable of the en...
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 0.8   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 0.8 M4   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-05 10:35 EST by Stephan Herrmann CLA
Modified: 2010-12-16 18:03 EST (History)
0 users

See Also:


Attachments
test & fix (3.20 KB, patch)
2010-12-05 10:40 EST, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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