Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311509 - Invalid access by "this" to a privat static base field, results in internal compiler error.
Summary: Invalid access by "this" to a privat static base field, results in internal c...
Status: VERIFIED WORKSFORME
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-04 06:19 EDT by Jan Marc Hoffmann CLA
Modified: 2010-05-06 10:29 EDT (History)
1 user (show)

See Also:


Attachments

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