Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
1.1-beta-2
-
None
-
None
-
Windows 2000
Groovy Version: 1.1-beta-2
JVM: 1.5.0_08-b03
Description
public class GenericTest<T> {
private T t
public GenericTest(T t)
public void print()
{ println t }public static void main(String[] args)
{ GenericTest<String> t = new GenericTest<String>(new Date()) //should be thrown a exception t.print() }}
The code: GenericTest<String> t = new GenericTest<String>(new Date()) should be thrown a exception due to Date is not a String type.
But it can run normally.
The issue also existed the following code snippet,
List<String> list = new ArrayList<String>()
list.add(new Date())