[jira] [Updated] (GROOVY-9570) Class-Level Closure Definition With Generics Fails TypeChecked

2022-01-31 Thread Eric Milles (Jira)


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

Eric Milles updated GROOVY-9570:

Fix Version/s: 2.5.16

> Class-Level Closure Definition With Generics Fails TypeChecked
> --
>
> Key: GROOVY-9570
> URL: https://issues.apache.org/jira/browse/GROOVY-9570
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.5, 3.0.0, 3.0.3
>Reporter: Ian
>Assignee: Eric Milles
>Priority: Major
> Fix For: 4.0.0-alpha-1, 3.0.6, 2.5.16
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
>  
>  
> {code:java}
> import groovy.transform.TypeChecked
> @TypeChecked
> abstract class A{
> Collection testQueue
> Closure c = {
> testQueue.each{T item->
> println item
> }
> }
> //def foo() {
> //testQueue.each{T item->
> //println item
> //}
> //}
> }
> new A(){}
> {code}
> Put this in filename.groovy and call "groovy filename.groovy" and I get
>  
> {noformat}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> /home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
> java.lang.Object but got T
>  @ line 7, column 24.
>testQueue.each{T item->
>   ^
> 1 error{noformat}
> Yet, uncomment the method foo() and there's no error there. or put the 
> closure definition into the method and there's no error.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (GROOVY-9570) Class-Level Closure Definition With Generics Fails TypeChecked

2020-05-22 Thread Ian (Jira)


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

Ian updated GROOVY-9570:

Description: 
 

 
{code:java}
import groovy.transform.TypeChecked

@TypeChecked
abstract class A{
Collection testQueue
Closure c = {
testQueue.each{T item->
println item
}
}
//def foo() {
//testQueue.each{T item->
//println item
//}
//}
}
new A(){}
{code}
Put this in filename.groovy and call "groovy filename.groovy" and I get

 
{noformat}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
java.lang.Object but got T
 @ line 7, column 24.
   testQueue.each{T item->
  ^
1 error{noformat}
Yet, uncomment the method foo() and there's no error there. or put the closure 
definition into the method and there's no error.

  was:
 

 
{code:java}
import groovy.transform.TypeChecked

@TypeChecked
abstract class A{
Collection testQueue
Closure c = {
testQueue.each{T item->
println item
}
}
//def foo() {
//testQueue.each{T item->
//println item
//}
//}
}
new A(){}
{code}
Put this in filename.groovy and call "groovy filename.groovy" and I get

 
{noformat}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
java.lang.Object but got T
 @ line 7, column 24.
   testQueue.each{T item->
  ^1 error{noformat}
Yet, uncomment the method foo() and there's no error there. or put the closure 
definition into the method and there's no error.


> Class-Level Closure Definition With Generics Fails TypeChecked
> --
>
> Key: GROOVY-9570
> URL: https://issues.apache.org/jira/browse/GROOVY-9570
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.5, 3.0.0, 3.0.3
>Reporter: Ian
>Priority: Major
>
>  
>  
> {code:java}
> import groovy.transform.TypeChecked
> @TypeChecked
> abstract class A{
> Collection testQueue
> Closure c = {
> testQueue.each{T item->
> println item
> }
> }
> //def foo() {
> //testQueue.each{T item->
> //println item
> //}
> //}
> }
> new A(){}
> {code}
> Put this in filename.groovy and call "groovy filename.groovy" and I get
>  
> {noformat}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> /home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
> java.lang.Object but got T
>  @ line 7, column 24.
>testQueue.each{T item->
>   ^
> 1 error{noformat}
> Yet, uncomment the method foo() and there's no error there. or put the 
> closure definition into the method and there's no error.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-9570) Class-Level Closure Definition With Generics Fails TypeChecked

2020-05-22 Thread Ian (Jira)


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

Ian updated GROOVY-9570:

Description: 
 

 
{code:java}
import groovy.transform.TypeChecked

@TypeChecked
abstract class A{
Collection testQueue
Closure c = {
testQueue.each{T item->
println item
}
}
//def foo() {
//testQueue.each{T item->
//println item
//}
//}
}
new A(){}
{code}
Put this in filename.groovy and call "groovy filename.groovy" and I get

 
{noformat}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
java.lang.Object but got T
 @ line 7, column 24.
   testQueue.each{T item->
  ^1 error{noformat}
Yet, uncomment the method foo() and there's no error there. or put the closure 
definition into the method and there's no error.

  was:
 

 
{code:java}
import groovy.transform.TypeChecked@TypeChecked
abstract class A{
Collection testQueue
Closure c = {
testQueue.each{T item->
println item
}
}
//def foo() {
//testQueue.each{T item->
//println item
//}
//}
}
new A(){}
{code}
Put this in filename.groovy and call "groovy filename.groovy" and I get

 
{noformat}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
java.lang.Object but got T
 @ line 7, column 24.
   testQueue.each{T item->
  ^1 error{noformat}
Yet, uncomment the method foo() and there's no error there. or put the closure 
definition into the method and there's no error.


> Class-Level Closure Definition With Generics Fails TypeChecked
> --
>
> Key: GROOVY-9570
> URL: https://issues.apache.org/jira/browse/GROOVY-9570
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.5, 3.0.0, 3.0.3
>Reporter: Ian
>Priority: Major
>
>  
>  
> {code:java}
> import groovy.transform.TypeChecked
> @TypeChecked
> abstract class A{
> Collection testQueue
> Closure c = {
> testQueue.each{T item->
> println item
> }
> }
> //def foo() {
> //testQueue.each{T item->
> //println item
> //}
> //}
> }
> new A(){}
> {code}
> Put this in filename.groovy and call "groovy filename.groovy" and I get
>  
> {noformat}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> /home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
> java.lang.Object but got T
>  @ line 7, column 24.
>testQueue.each{T item->
>   ^1 error{noformat}
> Yet, uncomment the method foo() and there's no error there. or put the 
> closure definition into the method and there's no error.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (GROOVY-9570) Class-Level Closure Definition With Generics Fails TypeChecked

2020-05-22 Thread Ian (Jira)


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

Ian updated GROOVY-9570:

Description: 
 

 
{code:java}
import groovy.transform.TypeChecked@TypeChecked
abstract class A{
Collection testQueue
Closure c = {
testQueue.each{T item->
println item
}
}
//def foo() {
//testQueue.each{T item->
//println item
//}
//}
}
new A(){}
{code}
Put this in filename.groovy and call "groovy filename.groovy" and I get

 
{noformat}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
java.lang.Object but got T
 @ line 7, column 24.
   testQueue.each{T item->
  ^1 error{noformat}
Yet, uncomment the method foo() and there's no error there. or put the closure 
definition into the method and there's no error.

  was:
import groovy.transform.TypeChecked

@TypeChecked
abstract class A{
Collection testQueue
Closure c = {
testQueue.each{T item->
println item
}
}
//def foo() {
//testQueue.each{T item->
//println item
//}
//}
}
new A(){}
Put this in filename.groovy and call "groovy filename.groovy" and I get
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
filename.groovy: 9: Expected parameter of type java.lang.Object but got T
 @ line 7, column 24.
   testQueue.each{T item->
  ^1 error
Yet, uncomment the method foo() and there's no error there. or put the closure 
definition into the method and there's no error.


> Class-Level Closure Definition With Generics Fails TypeChecked
> --
>
> Key: GROOVY-9570
> URL: https://issues.apache.org/jira/browse/GROOVY-9570
> Project: Groovy
>  Issue Type: Bug
>Affects Versions: 2.5.5, 3.0.0, 3.0.3
>Reporter: Ian
>Priority: Major
>
>  
>  
> {code:java}
> import groovy.transform.TypeChecked@TypeChecked
> abstract class A{
> Collection testQueue
> Closure c = {
> testQueue.each{T item->
> println item
> }
> }
> //def foo() {
> //testQueue.each{T item->
> //println item
> //}
> //}
> }
> new A(){}
> {code}
> Put this in filename.groovy and call "groovy filename.groovy" and I get
>  
> {noformat}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> /home/ianl/closureGeneric.groovy: 9: Expected parameter of type 
> java.lang.Object but got T
>  @ line 7, column 24.
>testQueue.each{T item->
>   ^1 error{noformat}
> Yet, uncomment the method foo() and there's no error there. or put the 
> closure definition into the method and there's no error.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)