Bug 214237 - Spurious "Incompatible conditional operand types" in instanceof expression
Summary: Spurious "Incompatible conditional operand types" in instanceof expression
Status: VERIFIED DUPLICATE of bug 205235
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.4 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-03 10:32 EST by Eric Inman CLA
Modified: 2008-02-13 16:48 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Inman CLA 2008-01-03 10:32:30 EST
Build ID: M20070921-1145

Steps To Reproduce:
Create a project with the following classes in the same package:

A.java:
import java.util.Collection;

public abstract class A
<T extends A<T,S>,S extends Collection<T>> {}

B.java:
import java.util.Collection;

public abstract class B extends A<D,Collection<D>> {
	boolean isD() {return this instanceof D;}
}

C.java:
public abstract class C extends B {
	boolean isD() {return this instanceof D;}
}

D.java:
public final class D extends C {}

In class C, "this instanceof D" will be underlined in red with the message "Incompatible conditional operand types C and D". However, no errors are indicated otherwise, such as in the Problems view. Also, the same code in class B is not marked as an error.


More information:
Probably occurs in combination with bug 214191, which seems similar to bug 35899.
Comment 1 Frederic Fusier CLA 2008-01-06 11:52:19 EST
I cannot reproduce using 3.4M4, but I could not identify which bug fix solved this problem. So, close as WORKSFORME for now
Comment 2 Jerome Lanneluc CLA 2008-01-09 06:45:23 EST
The "Incompatible conditional operand types" error is a side effect of the first "The hierarchy of the type C is inconsistent" error. This first error has been fixed by the fix for bug 205235.
Comment 3 Jerome Lanneluc CLA 2008-01-09 06:45:47 EST

*** This bug has been marked as a duplicate of bug 205235 ***
Comment 4 Maxime Daniel CLA 2008-02-04 07:30:23 EST
I could not find any test case reflecting this one in the tests. Is there one?

A manual test case passes with build I20080204-0010.
Comment 5 Maxime Daniel CLA 2008-02-05 04:08:24 EST
Released Java50Tests#testHierarchyCycleInstanceof in HEAD.

Verified for 34M5 using I20080204-0010 build.