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

Assert fails when accessing particular primitive values with @CompileStatic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.5
    • 2.4.7
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: