Bug 85157 - [compiler] Integer[] is not compatible with String[] in conditional expression
Summary: [compiler] Integer[] is not compatible with String[] in conditional expression
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-14 12:28 EST by Olivier Thomann CLA
Modified: 2005-02-15 13:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2005-02-14 12:28:14 EST
Compiling this code should lead to an error about incompatible types, but we
crash with an internal compiler error.

public class X {
	public static void main(String argv[]) {
		String[] tab1 = new String[0];
		Integer[] tab2 = new Integer[0];
		boolean cond = true;
		Integer[] var = cond ? tab1 : tab2;
		System.out.println(var);
	}
}
Comment 1 Philipe Mulet CLA 2005-02-14 18:03:31 EST
Least containing invocation should have answered the type when no alternate
invocation is present.
Added GenericTypeTest#test499.
Fixed
Comment 2 Jerome Lanneluc CLA 2005-02-15 13:04:40 EST
Verified in I20050215-0800