Community
Participate
Working Groups
HEAD The snippet below produces 2 errors: 1) FileInputStream cannot be resolved to a type 2) Incompatible conditional operand types InputStream and FileInputStream The second error is not interesting and should not be reported as long as the RHS of the instanceof expression is not resolved. package xy; import java.io.InputStream; public class Try { void foo(InputStream is) { if (is instanceof FileInputStream) System.out.println("Hello"); } }
I'll take a look
The fix seems trivial. If the checkedType is not a valid binding, we should not check for checkCastTypesCompatibility(..). I'll attach a patch that can be reviewed.
Created attachment 229063 [details] Proposed fix Regression test needs to be added and all tests need to be run. We might already have a test that returns an extra secondary error.
Jay, please review.
(In reply to comment #4) > Jay, please review. Patch looks good, will release after running the tests.
Fix released here along with new tests: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=5ccdb7e247bbbd1f8f7142380f221525938bf5a9
Verified for 3.7 M7 using build I20130428-2000.