groovy
  1. groovy
  2. GROOVY-5329

Allow static type checking to be turned off for individual classes/methodss

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-2
    • Fix Version/s: 2.0-beta-3
    • Component/s: Static Type Checker
    • Labels:
      None
    • Number of attachments :
      0

      Description

      In general I want to turn on static type checking at a fairly high granularity, such as entire class (or package if you implement package-level type checking). I may want to turn type checking off for an individual sub-unit. If for example I have a class with a lot of methods, and want to turn off checking for one method, I don't want to have to annotate every single method with @TypeChecked except the one exception.

        Activity

        Hide
        CÚdric Champeau added a comment -

        Both @TypeChecked and @CompileStatic now support an optional value parameter which allows a method to be skipped. For example:

        @groovy.transform.TypeChecked(groovy.transform.TypeCheckingMode.SKIP)
        

        or, short version with imports:

        @TypeChecked(SKIP)
        
        Show
        CÚdric Champeau added a comment - Both @TypeChecked and @CompileStatic now support an optional value parameter which allows a method to be skipped. For example: @groovy.transform.TypeChecked(groovy.transform.TypeCheckingMode.SKIP) or, short version with imports: @TypeChecked(SKIP)

          People

          • Assignee:
            CÚdric Champeau
            Reporter:
            Jeff Sussna
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: