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

Bug 311509

Summary: Invalid access by "this" to a privat static base field, results in internal compiler error.
Product: [Tools] Objectteams Reporter: Jan Marc Hoffmann <exelnet>
Component: OTJAssignee: Project Inbox <objectteams.otj-inbox>
Status: VERIFIED WORKSFORME QA Contact:
Severity: minor    
Priority: P3 CC: stephan.herrmann
Version: 1.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jan Marc Hoffmann CLA 2010-05-04 06:19:54 EDT
Reproduce:

public class Base {
	
	private static boolean field = true; 

	public void m(){
		
	}
}

public team class SomeTeam {
	
	protected class SomeRole playedBy Base {
		
		m <-replace m;
		
		@SuppressWarnings({ "inferredcallout", "decapsulation" })
		callin void m(){
			boolean v = this.field;
			System.out.println(v);			
		}
	}

}


Results in:

Description	Resource	Path	Location	Type
Internal compiler error: java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding at org.eclipse.jdt.internal.compiler.ast.FieldReference.manageSyntheticAccessIfNecessary(FieldReference.java:474)	SomeTeam.java	/otdtbugs/src/otdtbugs/inferredprivatestatic	line 0	Java Problem
Comment 1 Stephan Herrmann CLA 2010-05-04 08:20:40 EDT
This has already been fixed in r147 (20100408).
Comment 2 Stephan Herrmann CLA 2010-05-06 10:29:02 EDT
Verified for M2 using I201005052210