Bug 210422 - [compiler] Need to have local bindings created in error cases
Summary: [compiler] Need to have local bindings created in error cases
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 210070
  Show dependency tree
 
Reported: 2007-11-20 12:38 EST by Jerome Lanneluc CLA
Modified: 2007-12-11 11:24 EST (History)
0 users

See Also:


Attachments
Changes made by Philippe on my machine (18.62 KB, patch)
2007-11-20 12:39 EST, Jerome Lanneluc CLA
no flags Details | Diff
Proposed patch (28.91 KB, patch)
2007-11-21 09:14 EST, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2007-11-20 12:38:47 EST
I20071113-0800

The following example shows that resolution of QualifiedAllocationExpression aborts to early and local type binding are not created. This is needed for bug 210070.

import java.io.Serializable;

public final class X implements Serializable {

	void bar() {}
	
	interface IM {}
	class SMember extends String {}
	
	@Annot(value = new SMember())
	class Member extends X {  
		ZorkMember z;
		void foo() {
			this.bar();
			Zork1 z;
		} 
	}
	
	@Annot(value = 
		new X(){
			ZorkAnonymous1 z;
			void foo() {
				this.bar();
				Zork2 z;
			}
		})
	void foo() {
		new X().new IM();
		class Local extends X { 
			ZorkLocal z;
			void foo() {
				this.bar();
				Zork3 z;
			}
		}
		new X() {
			ZorkAnonymous2 z;			
			void foo() {
				this.bar();
				Zork4 z;
			}
		};
	}
}
@interface Annot {
	String value();
}
Comment 1 Jerome Lanneluc CLA 2007-11-20 12:39:58 EST
Created attachment 83344 [details]
Changes made by Philippe on my machine
Comment 2 Philipe Mulet CLA 2007-11-20 13:10:03 EST
Added InnerEmulationTest#test150
Added AnnotationTest#test242
Comment 3 Philipe Mulet CLA 2007-11-21 04:20:28 EST
In addition to still creating as much of a binding as we can, need to align inconsistent hierarchies for anonymous in similar way to other types. In particular, when extending final/enum, Object should be substituted etc... (which wasn't the case).
Comment 4 Philipe Mulet CLA 2007-11-21 09:14:36 EST
Created attachment 83429 [details]
Proposed patch
Comment 5 Philipe Mulet CLA 2007-11-21 09:15:41 EST
Released for 3.4M4.
Fixed
Comment 6 Kent Johnson CLA 2007-12-11 11:24:10 EST
Verified for 3.4M4 using build I20071210-1800.