Bug 17104 - Compiler does not complain but "Quick Fix" ??? complains
Summary: Compiler does not complain but "Quick Fix" ??? complains
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC other
: P3 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 23382 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-22 17:47 EDT by Silenio Quarti CLA
Modified: 2002-10-17 10:10 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 Silenio Quarti CLA 2002-05-22 17:47:16 EDT
Import the classes below and you will see that "SwitchTest"
has no compiler errors, but it has a "light icon" in the
line "case OS.CONST: return;" with the following tooltip text:

    "Type mismatch: cannot convert from int to short"

public class OS {
	public static final int CONST = 23 * 1024;
}
public class SwitchTest {
	public short c;	
	public static void main(String[] arguments) {
		short c = 1;
		switch (c) {
			case OS.CONST: return;
		}
	}
}
Comment 1 Martin Aeschlimann CLA 2002-05-30 06:01:43 EDT

*** This bug has been marked as a duplicate of 18175 ***
Comment 2 David Audel CLA 2002-06-05 10:54:09 EDT
This isn't a duplicate of 18175. Moving to JDT/Core for fixing
Comment 3 Philipe Mulet CLA 2002-06-05 11:13:54 EDT
Until field constants are part of the JavaModel, we have to live with this bug, 
since the compiler is only authorizing type mismatch if the constant is 
representable into the target type.

Deferring
Comment 4 Philipe Mulet CLA 2002-09-18 07:37:49 EDT
We want to address this for 2.1, by persisting field initialization source 
inside the model, for further usage - in particular for temp problems while 
reconciling.
Comment 5 Philipe Mulet CLA 2002-09-18 07:38:31 EDT
2.1-M2 candidate
Comment 6 Philipe Mulet CLA 2002-09-30 06:21:02 EDT
*** Bug 23382 has been marked as a duplicate of this bug. ***
Comment 7 Jerome Lanneluc CLA 2002-10-08 10:38:08 EDT
Changed Java model to persist the initialization source. Added flag on 
SourceTypeConverter to compute the AST from the initialization source if 
needed. Changed CompilationUnitProblemFinder to use this flag.
Comment 8 David Audel CLA 2002-10-17 10:10:48 EDT
Verified.