Bug 21556 - "Missing code implementation in the compiler"
Summary: "Missing code implementation in the compiler"
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-12 14:28 EDT by rolarenfan CLA
Modified: 2002-07-16 06:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rolarenfan CLA 2002-07-12 14:28:44 EDT
R1.0, build 137 

I will post code that reproduces this, once I can extract it (at the moment its 
all enmeshed in our multi-thousand-line plugin) ... 

I have two classes in two of our packages:
     editors.Editor (extends EditorPart)
     operations.Updater 
         (extends operations.Modifier which itself extends only Object)
         has a protected static inner class UpdateOperation 
             (that is an extension of WorkspaceModifyOperation) 

All is well; there are no errors anywhere.

Now I create a third class Preparer, which implements Runnable, and which
both Editor and Updater (and UpdateOperation) need to know about:
     if I put it into Editor as a public static inner class, all is well;
     if I make it a top-level class in operations, all is well; 
     if I put it into Updater as an public static inner class, I get the 
compiler-bug error, on line 1 of Editor.
Comment 1 Philipe Mulet CLA 2002-07-12 17:44:05 EDT
I remember we fixed a couple such scenarii in the 2.0 stream.
You might want to give it a try with the R2.0 build so as to see if this bug 
got fixed already.
Comment 2 Philipe Mulet CLA 2002-07-15 07:10:48 EDT
This would be a duplicate of old bug 1GL1HF8 - Missing implementation in the 
compiler compiling invalid code (referenced in build notes, section for build 
20011011). Bug also archived internally as: 
http://bugs.ott.oti.com/show_bug.cgi?id=73682

------------ begin original RPRS header -----------------------------
PRID: 1GL1HF8
Title: ITPJCORE:WIN2000 - Missing implementation in the compiler compiling 
invalid code
Plan: C - No Commitment
Severity: 0 - Information Exchange
Customer: INTERNAL
Contact: Olivier Thomann
Owner: Olivier Thomann
CPRID: 
Creator: Olivier Thomann
Create Date: Sat Nov 03 18:51:54 EST 2001
Component Name: ITPJCORE - Java IDE Core
Editor: Philippe Mulet
Edit Date: Fri Nov 09 18:51:54 EST 2001
Edit Time: Tue Mar 26 05:20:39 EST 2002
Folder Name: Component Root\Closed\Fixed\
------------ end original RPRS header -------------------------------

PRODUCT VERSION:
	202 HEAD

DESCRIPTION:
[class D {
	class E {
		E(Object o, Object o1, Object o2, F f) {}
		void execute() {}
	}
}

class F {
	F(Object o) {
	}
}

public class A2 {
	private abstract class B {
		public Object get() {
			return null;
		}
	}

	private class C extends B {

		public void foo() {
			(new D.E(null, null, null, new F(get()) {}) {}).execute
();
		}
	}
}
]

	Compiling the code above. I got:
1. ERROR in D:/temp/A2.java
!! no source information available !!
Missing code implementation in the compiler
----------
Compiled 26 lines in 1773 ms (14.6 lines/s)
1 problem (1 error)

	javac 1.3 reports the problem nicely:
A2.java:23: No enclosing instance of class D is in scope; an explicit one must 
be provided when creating inner class D. E, as in "outer. new Inner()" 
or "outer. super()".
                        (new D.E(null, null, null, new F(get()) {}) {}).execute
();
                         ^
A2.java:23: Incompatible type for constructor. Can't convert A2.C to D.
                        (new D.E(null, null, null, new F(get()) {}) {}).execute
();
                         ^
2 errors

NOTES:

	OT (03/10/2001 5:20:19 PM)
		If I change this code to be: 
[class D {
	class E {
		E(Object o, Object o1, Object o2, F f) {}
		void execute() {}
	}
}

class F {
	F(Object o) {
	}
}

public class A2 {
	private abstract class B {
		public Object get() {
			return null;
		}
	}

	private class C extends B {

		public void foo() {
			(new D(). new E(null, null, null, new F(get()) {}) 
{}).execute();
		}
	}
}
]

	Then there is no more problem.
	If I write:
[class D {
	class E {
		E() {}
		void execute() {}
	}
}

public class A2 {
	private class C {

		public void foo() {
			new D.E().execute();
		}
	}
}
]
	It works fine and I got:
1. ERROR in D:/temp/A2.java (at line 12)
	new D.E().execute();
	^^^^^^^^^
Must explicitly qualify the allocation with an enclosing instance of type D 
(e.g. x.new A() where x is an instance of D).
----------
Compiled 15 lines in 1732 ms (8.6 lines/s)
1 problem (1 error)

PM (10/8/2001 6:37:00 PM)
	Incorrect error reporting caused to enter inappropriate code path. 
Added 3 regression tests.
	Fixed.

--------------------------------------------------------------------------------
Comment 3 Philipe Mulet CLA 2002-07-15 07:12:31 EDT
The 3 regression tests are: InnerEmulationTest#test33, test34, test35
Comment 4 Philipe Mulet CLA 2002-07-16 06:56:21 EDT
Closing, please reopen if symptoms persist in R2.0.