Groovy
  1. Groovy
  2. GROOVY-5154

Invalid Static Type Checking report on a method call with type parameters

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: 2.0-beta-2
    • Component/s: None
    • Labels:
      None

      Description

      The following code produces static type checking error:

      import groovy.transform.*
      
      @TypeChecked 
      class Foo {
          def say() {
              FooWithGenerics f
              FooBound fb
              f.say(fb)
          }
      }
      
      class FooWithGenerics {
          def <T extends FooBound> void say(T p) {
          }
      }
      class FooBound {
      }
      

        Activity

        Mark Thomas made changes -
        Workflow jira [ 12971609 ] Default workflow, editable Closed status [ 12979426 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12734078 ] Default workflow, editable Closed status [ 12745888 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Cédric Champeau made changes -
        Fix Version/s 2.0-beta-2 [ 18072 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Assignee Cedric Champeau [ melix ]
        Roshan Dawrani made changes -
        Field Original Value New Value
        Description The following code produces static type checking error:

        import groovy.transform.*

        @TypeChecked
        class Foo {
            def say() {
                FooWithGenerics f
                FooBound fb
                f.say(fb)
            }
        }

        class FooWithGenerics {
            def <T extends FooBound> void say(T p) {
            }
        }
        class FooBound {
        }
        The following code produces static type checking error:

        {code}
        import groovy.transform.*

        @TypeChecked
        class Foo {
            def say() {
                FooWithGenerics f
                FooBound fb
                f.say(fb)
            }
        }

        class FooWithGenerics {
            def <T extends FooBound> void say(T p) {
            }
        }
        class FooBound {
        }
        {code}
        Valery Shyshkin created issue -

          People

          • Assignee:
            Cédric Champeau
            Reporter:
            Valery Shyshkin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development