Bug 85157

Summary: [compiler] Integer[] is not compatible with String[] in conditional expression
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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