Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 1.1-beta-2
    • Fix Version/s: 1.1-beta-3
    • Component/s: None
    • Labels:
      None
    • Environment:
      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)

      { this.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())

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              tiger_shark Tiger Shark
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: