[jira] [Updated] (GROOVY-9253) Comparison between Enum and other objects should fail

2022-11-04 Thread Eric Milles (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles updated GROOVY-9253:

Labels: enum  (was: )

> Comparison between Enum and other objects should fail
> -
>
> Key: GROOVY-9253
> URL: https://issues.apache.org/jira/browse/GROOVY-9253
> Project: Groovy
>  Issue Type: Bug
>Reporter: Xiaoguang Wang
>Priority: Major
>  Labels: enum
>
> 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.
>  
> {code:java}
> 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.
> }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (GROOVY-9253) Comparison between Enum and other objects should fail

2019-09-16 Thread Xiaoguang Wang (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiaoguang Wang updated GROOVY-9253:
---
Description: 
In Java, comparison between Enum and other objects always fail.

Groovy can follow the same behavior (at least in {{@CompileStatic}} mode) to 
keep consistency.

 
{code:java}
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.
}
}

{code}

  was:
In Java, comparison between Enum and other objects always fail.

Groovy can follow the same behavior (at least in @CompileStatic mode) 
to keep consistency.

 
{code:java}
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.
}
}

{code}


> Comparison between Enum and other objects should fail
> -
>
> Key: GROOVY-9253
> URL: https://issues.apache.org/jira/browse/GROOVY-9253
> Project: Groovy
>  Issue Type: Bug
>Reporter: Xiaoguang Wang
>Priority: Major
>
> In Java, comparison between Enum and other objects always fail.
> Groovy can follow the same behavior (at least in {{@CompileStatic}} mode) to 
> keep consistency.
>  
> {code:java}
> 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.
> }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Updated] (GROOVY-9253) Comparison between Enum and other objects should fail

2019-09-16 Thread Xiaoguang Wang (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiaoguang Wang updated GROOVY-9253:
---
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.

 
{code:java}
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.
}
}

{code}

  was:
In Java, comparison between Enum and other objects always fail.

Groovy can follow the same behavior (at least in {{@CompileStatic}} mode) to 
keep consistency.

 
{code:java}
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.
}
}

{code}


> Comparison between Enum and other objects should fail
> -
>
> Key: GROOVY-9253
> URL: https://issues.apache.org/jira/browse/GROOVY-9253
> Project: Groovy
>  Issue Type: Bug
>Reporter: Xiaoguang Wang
>Priority: Major
>
> 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.
>  
> {code:java}
> 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.
> }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Updated] (GROOVY-9253) Comparison between Enum and other objects should fail

2019-09-16 Thread Xiaoguang Wang (Jira)


 [ 
https://issues.apache.org/jira/browse/GROOVY-9253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiaoguang Wang updated GROOVY-9253:
---
Description: 
In Java, comparison between Enum and other objects always fail.

Groovy can follow the same behavior (at least in @CompileStatic mode) 
to keep consistency.

 
{code:java}
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.
}
}

{code}

  was:
In Java, comparison between Enum and other objects always fail.

Groovy can follow the same behavior (at least in `@CompileStatic` mode) to keep 
consistency.

 
{code:java}
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.
}
}

{code}


> Comparison between Enum and other objects should fail
> -
>
> Key: GROOVY-9253
> URL: https://issues.apache.org/jira/browse/GROOVY-9253
> Project: Groovy
>  Issue Type: Bug
>Reporter: Xiaoguang Wang
>Priority: Major
>
> In Java, comparison between Enum and other objects always fail.
> Groovy can follow the same behavior (at least in @CompileStatic mode) 
> to keep consistency.
>  
> {code:java}
> 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.
> }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)