Bug 59723 - [1.5] Compiler rejects usage of ArrayList.toArray(char[][])
Summary: [1.5] Compiler rejects usage of ArrayList.toArray(char[][])
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-22 18:00 EDT by Philipe Mulet CLA
Modified: 2005-01-11 11:02 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 Philipe Mulet CLA 2004-04-22 18:00:26 EDT
Cheetah03

The following program should compile clear:
import java.util.ArrayList;

public class X {
	public static void main(String[] args) {
	    char[][] tokens = new char[0][];
	    ArrayList list = new ArrayList();
		list.toArray(tokens);
    }    	
}
Comment 1 Philipe Mulet CLA 2004-04-22 18:03:17 EDT
Compiler says toArray(char[][]) is not applicable with char[][].
Problem is that one of these char[][] is actually incorrectly build as: 
(char[])[].

The code substituting T[] where T is char[], is incorrectly building the bogus 
array type.

Adding regression test: GenericTypeTest#test147.
Fixed.