Bug 508306 - Indirectly referenced class file error if generic super type in library references a type absent from classpath
Summary: Indirectly referenced class file error if generic super type in library refer...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-28 10:26 EST by Jean-Marie HENAFF CLA
Modified: 2016-11-28 15:35 EST (History)
1 user (show)

See Also:


Attachments
Sample eclipse project (2.24 MB, application/gzip)
2016-11-28 10:26 EST, Jean-Marie HENAFF CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Marie HENAFF CLA 2016-11-28 10:26:13 EST
Created attachment 265613 [details]
Sample eclipse project

I've attached a sample project to reproduce the issue.

Basically, Test<T> inherits from LibType<T>.
Test belongs to the source files to compile.
LibType is in a library on classpath, but references TypeMissingFromClasspath, which is not the classpath when Test is compiled.

Things that seem to trigger the bug:
- LibType has to be generic
- Test must define a constructor with a parameter

Reproduced with ecj 4.7M3.

Compiles with javac.
Comment 1 Stephan Herrmann CLA 2016-11-28 15:35:52 EST
Essentially, no guarantees are made that compilation with an incomplete classpath will succeed. A typical scenario is overload resolution, where all compilers need even types that are not referenced in any way by the current source file.

I agree, however, that in this particular example it would be *nice* if ecj avoids touching TypeMissingFromClasspath.