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

Assert fails when accessing particular primitive values with @CompileStatic

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.4.7
    • Component/s: None
    • Labels:
      None

      Description

      The following assert for a non-zero long value fails when annotated with CompileStatic. For example:

      def foo() {
        long value = 17179869184 
        assert value, "Foo is OK"
      }
      
      @groovy.transform.CompileStatic
      def bar() {
        long value = 17179869184 
        assert value, "Bar failed"
      }
      
      foo()
      bar()
      
      
      java.lang.AssertionError: Bar failed. Expression: value. Values: value = 17179869184
      	at ConsoleScript31.bar(ConsoleScript31:10)
      	at ConsoleScript31.run(ConsoleScript31:14)
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                pablo72 paolo di tommaso
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: