Groovy
  1. Groovy
  2. GROOVY-5073 GEP 8 - Static Type Checking
  3. GROOVY-3014

add an annotation that forces the compiler to check methods for their existence at compile time

    Details

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

      Description

      coming from Java it is a bit difficult for some users to find their way into dynamic programming, especially when it comes to method being there or not. therefor I suggested an annotation with source visibility, that can be used by the compiler to check if a method actually exists. This will slow down compilation a bit and may not be supported by IDEs as of yet. Also the check will be a check only, it will not force any kind of method selection at runtime. I suggested to let the compiler throw an error if the annotation forces compiler to check if a method exists, but is unknown, because I am against warnings. the annotation should be used at method or class scope.

        Activity

        Jochen Theodorou created issue -
        Guillaume Delcroix made changes -
        Field Original Value New Value
        Fix Version/s 1.6-beta-2 [ 14261 ]
        Fix Version/s 1.5.7 [ 14242 ]
        Fix Version/s 1.5.8 [ 14630 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.5.8 [ 14630 ]
        Fix Version/s 1.6.2 [ 15151 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.6.2 [ 15151 ]
        Fix Version/s 1.6.3 [ 15251 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Fix Version/s 1.6.3 [ 15251 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Fix Version/s 1.7-beta-x [ 15538 ]
        Hide
        Michael Lawler added a comment -

        My company haS a rather large framework built on java and groovy. We prefer to code in groovy than java, but we miss compile-time checks when we are not using dynamic language features such as method missing. When your code base grows over 200k LOC, then compile time interface checking is a nice option.

        It would be nice to be able to instruct the compiler to throw errors when compiling modules/classes/methods that we explicitly tell it don't use dynamic stuff.

        Show
        Michael Lawler added a comment - My company haS a rather large framework built on java and groovy. We prefer to code in groovy than java, but we miss compile-time checks when we are not using dynamic language features such as method missing. When your code base grows over 200k LOC, then compile time interface checking is a nice option. It would be nice to be able to instruct the compiler to throw errors when compiling modules/classes/methods that we explicitly tell it don't use dynamic stuff.
        Hide
        Jochen Theodorou added a comment -

        We are about to start a project under the name Grumpy, which will do static checking of Groovy code. Don't be afraid, it is only the name till we find a better one With this only a subset of Groovy will compile. But it will check method calls and assignments like in Java. Would this help you in your case?

        Show
        Jochen Theodorou added a comment - We are about to start a project under the name Grumpy, which will do static checking of Groovy code. Don't be afraid, it is only the name till we find a better one With this only a subset of Groovy will compile. But it will check method calls and assignments like in Java. Would this help you in your case?
        Hide
        Michael Lawler added a comment -

        Sounds good Jochen. I will keep a look out for further details.

        But sorry, I can't give you a +1 on the name

        Show
        Michael Lawler added a comment - Sounds good Jochen. I will keep a look out for further details. But sorry, I can't give you a +1 on the name
        Cédric Champeau made changes -
        Assignee Jochen Theodorou [ blackdrag ] Cedric Champeau [ melix ]
        Cédric Champeau made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Cédric Champeau made changes -
        Parent GROOVY-5073 [ 130431 ]
        Issue Type Improvement [ 4 ] Sub-task [ 7 ]
        Hide
        Will P added a comment -

        It would be very nice. We have somewhat about 170k LOC (160k java, 10k groovy) and since we don't have enough tests, we are holding the groovy coding. We will surely adopt more groovy code on our systems with those checks. (though we will have to wait for GREclipse getting it too).

        Show
        Will P added a comment - It would be very nice. We have somewhat about 170k LOC (160k java, 10k groovy) and since we don't have enough tests, we are holding the groovy coding. We will surely adopt more groovy code on our systems with those checks. (though we will have to wait for GREclipse getting it too).
        Hide
        Jochen Theodorou added a comment -

        The eclipse plugin uses the groovy compiler. So if the groovy compiler can do that, and the eclipse plugin uses that groovy version, then you will have that ability in greclipse right away

        Show
        Jochen Theodorou added a comment - The eclipse plugin uses the groovy compiler. So if the groovy compiler can do that, and the eclipse plugin uses that groovy version, then you will have that ability in greclipse right away
        Cédric Champeau made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 1.7.x [ 15538 ]
        Fix Version/s 2.0-beta-1 [ 17925 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12732024 ] Default workflow, editable Closed status [ 12743908 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12973478 ] Default workflow, editable Closed status [ 12980681 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        1147d 5h 18m 1 Cédric Champeau 12/Oct/11 11:28
        In Progress In Progress Resolved Resolved
        127d 17h 29m 1 Cédric Champeau 17/Feb/12 03:58
        Resolved Resolved Closed Closed
        85d 23h 32m 1 Paul King 13/May/12 04:30

          People

          • Assignee:
            Cédric Champeau
            Reporter:
            Jochen Theodorou
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development