Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7807

CompileStatic doesn't call asBoolean

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.4.4
    • None
    • Static compilation
    • None

    Description

      I have a class that implements asBoolean:

      class Foo {
         
          /**
           * @return whether any properties are <tt>true</tt>
           */
          boolean asBoolean() {
              foo || bar || keks || blorb
          }
      
      }
      

      When using this class in a class that has @CompileStatic applied to it, the asBoolean method is not called in a ternary expression.

      May be related to GROOVY-6802.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            blackdrag Jochen Theodorou
            johann Johann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment