Bug 101387 - [1.5][compiler] Incorrect Cycle detected in type hierarchy error
Summary: [1.5][compiler] Incorrect Cycle detected in type hierarchy error
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-22 21:05 EDT by Carl Quinn CLA
Modified: 2005-09-26 11:01 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 Carl Quinn CLA 2005-06-22 21:05:58 EDT
The compiler is incorrectly reporting a problem with parameterized classes when their parameters are 
populated using nested classes more than one level deep. The code in question compiles & runs fine 
under javac. Greatly simplified test case (which I think should compile):

abstract class ObjectInput {}

abstract class Factory<O, I extends ObjectInput, C extends I> {}

class Foo {}

public class FooFactory extends 
    Factory<Foo, FooFactory.Input, FooFactory.CreateInput> {

  static class Input extends ObjectInput {}
  
  static class CreateInput extends Input {}
}

There are then errors reported on the "Input" near the end, on the "FooFactory.CreateInput" in the 
FooFactory parameter population, and on "FooFactory" itself. 

I think the primal error is the one on "Input", which is: "Cycle detected: a cycle exists in the type 
hierarchy between FooFactory.CreateInput and FooFactory"
Comment 1 Philipe Mulet CLA 2005-06-23 03:39:36 EDT
Reproduced in RC3
Comment 2 Kent Johnson CLA 2005-06-23 10:55:14 EDT
Simpler testcase:

class X<I, C extends I> {}

class Y extends X<Y.M, Y.N> {
	static class M {}
	static class N extends M {}
}
Comment 3 Kent Johnson CLA 2005-07-05 14:45:49 EDT
Released into the 3.1.1 branch
Comment 4 Kent Johnson CLA 2005-07-05 14:46:14 EDT
Added GenericTypeTest test050b
Comment 5 Olivier Thomann CLA 2005-08-09 10:53:06 EDT
Verified in 3.2M1 (I20050808-2000)
Comment 6 Olivier Thomann CLA 2005-09-26 11:01:27 EDT
Verified for 3.1.1 using M20050923-1430.