Summary: | [1.5][compiler[ code generation error in M5 w/regard to generics | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Eric Goff <goffster> | ||||||||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||
Severity: | blocker | ||||||||||||
Priority: | P3 | ||||||||||||
Version: | 3.1 | ||||||||||||
Target Milestone: | 3.1 M6 | ||||||||||||
Hardware: | PC | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Attachments: |
|
Description
Eric Goff
2005-02-19 22:49:46 EST
I meant to say............... If I change the snippet slightly to: public void foo() { for(MatGroup.Ctrl<?,?> glmat: ...) { GLMatGroup.View<?,?> view = glmat.getView() ; view.setTempAppearance() ; } } I really really really meant to say............... If I change the snippet slightly to: public void foo() { for(MatGroup.Ctrl<?,?> glmat: ...) { MatGroup.View<?,?> view = glmat.getView() ; view.setTempAppearance() ; } } Cannot reproduce in M5. Tried the following and it worked fine: import java.io.PrintStream; import java.util.List; public class X { public static void main(String argv[]) { System.out.println("SUCCESS"); } public void foo(List<MatGroup.Ctrl<?,?>> list) { for(MatGroup.Ctrl<?,?> glmat: list) { glmat.getView().setTempAppearance() ; } } } class MatGroup { static class Model {} static class View<T extends Model> { public void setTempAppearance() {} } static class Ctrl<T extends Model,U extends View<T>> { View getView() { return null; } } } Please provide exact steps to reproduce, then reopen Reopen once steps are available I regret that I do not have the time to get a small test case. However.......... The very fact that I got that stack trace absolutely shows that there is a bug in eclipse. that error should never ever ever occur. I was really hoping someone could actually analyze the error and see how it *could* happen. I urge you to take a second glance and not dismiss the bug simply for lack of a test case. It is 100% a bug and a bug of the very worst kind (generating bad byte code). Closing REMIND doesn't mean there is no bug, it simply mean that we request the reporter more information. This defect is interesting, however the steps are inaccurate, and do not reproduce. We have quite a few other defects which can be solved today, and thus closing REMIND helps to focus on bugs for which we can take immediate actions. You seem to be able to reproduce it, and you need to communicate better steps for this defect to be addressed (again not saying we have no bug) Created attachment 18733 [details]
IController.java
Created attachment 18734 [details]
IView.java
Created attachment 18735 [details]
MatGroup.java
Created attachment 18736 [details]
foobar.java
Compile the 4 attached java files with 3.1M5a and you get: Exception in thread "main" java.lang.VerifyError: (class: foobar, method: main signature: ([Ljava/lang/String;)V) Incompatible object argument for function call cheers You get the error when you run, not when you compile. sorry. Reproduced. Thanks for the testcase. #getView() invocation is missing trailing generic cast to View. This is due to optimization for unbound/super wildcards. Fixed. Added GenericTypeTest#test560 Verified in I20050330-0500 |