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

Static type checking - Color.red recognized as int

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.5
    • 2.0.6, 2.1.0-beta-1
    • Static Type Checker
    • Groovy-Eclipse plugin Version: 2.7.2.xx-20121031-1500-e42
      Groovy compiler level: 2.0

    Description

      Code:

      import groovy.transform.TypeChecked;
      import java.awt.Color;

      class ColorTest
      {
      @TypeChecked
      static main(args)

      { Color black = Color.black; // ok Color red = Color.red; // Groovy:[Static type checking] - Cannot assign value of type int to variable of type java.awt.Color }

      }

      This occurs only with colors: 'red', 'blue' and 'green'.

      Attachments

        Activity

          People

            melix Cédric Champeau
            lvanek Lumir Vanek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: