Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
In Java, comparison between Enum and other objects always triggers an error when compiling.
Groovy can follow the same behavior (at least in @CompileStatic mode) to keep consistency.
package com.company.test import groovy.transform.CompileStatic @CompileStatic class TestEnumGroovy { enum E { a,b } static void main(String[] args) { E x = E.a String s = "A" System.out.print(x == s) // it causes an error in Java. But Groovy doesn't see the error. } }