[jira] [Commented] (GROOVY-8609) Fails to compile when upper bound has generics

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492261#comment-16492261
 ] 

ASF GitHub Bot commented on GROOVY-8609:


GitHub user danielsun1106 opened a pull request:

https://github.com/apache/groovy/pull/730

GROOVY-8609  Fails to compile when upper bound has generics



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/danielsun1106/groovy GROOVY-8609

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/730.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #730


commit e07d69b37c44ce636ca57b1a658304972cb590ce
Author: Daniel Sun 
Date:   2018-05-28T04:41:48Z

GROOVY-8609  Fails to compile when upper bound has generics




> Fails to compile when upper bound has generics
> --
>
> Key: GROOVY-8609
> URL: https://issues.apache.org/jira/browse/GROOVY-8609
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation, Static Type Checker
>Affects Versions: 2.6.0-alpha-3, 3.0.0-alpha-2, 2.5.0
>Reporter: Daniel Sun
>Assignee: Daniel Sun
>Priority: Major
>
> Fails to compile the following code:
> {code:java}
> @groovy.transform.CompileStatic
> public class A, E extends Map> {
> E getFirstRecord(T recordList) {
> return recordList.get(0);
> }
> }
> {code}
> *Error messages:*
> {code:java}
> BUG! exception in phase 'instruction selection' in source unit 
> 'ConsoleScript0' Expected earlier checking to detect generics parameter arity 
> mismatch
> Expected: java.util.Map 
> Supplied: java.util.Map 
>   at 
> org.codehaus.groovy.ast.tools.GenericsUtils.extractPlaceholders(GenericsUtils.java:169)
>   at 
> org.codehaus.groovy.ast.tools.GenericsUtils.extractPlaceholders(GenericsUtils.java:142)
>   at 
> org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.compareGenericsWithBound(GenericsType.java:375)
>   at 
> org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.checkGenerics(GenericsType.java:307)
>   at 
> org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.matches(GenericsType.java:276)
>   at 
> org.codehaus.groovy.ast.GenericsType.isCompatibleWith(GenericsType.java:198)
>   at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkTypeGenerics(StaticTypeCheckingVisitor.java:1174)
>   at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkReturnType(StaticTypeCheckingVisitor.java:2076)
>   at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor$1.returnStatementAdded(StaticTypeCheckingVisitor.java:309)
>   at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitReturnStatement(StaticTypeCheckingVisitor.java:2026)
>   at 
> org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:49)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] groovy pull request #730: GROOVY-8609 Fails to compile when upper bound has ...

2018-05-27 Thread danielsun1106
GitHub user danielsun1106 opened a pull request:

https://github.com/apache/groovy/pull/730

GROOVY-8609  Fails to compile when upper bound has generics



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/danielsun1106/groovy GROOVY-8609

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/730.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #730


commit e07d69b37c44ce636ca57b1a658304972cb590ce
Author: Daniel Sun 
Date:   2018-05-28T04:41:48Z

GROOVY-8609  Fails to compile when upper bound has generics




---


[jira] [Assigned] (GROOVY-8609) Fails to compile when upper bound has generics

2018-05-27 Thread Daniel Sun (JIRA)

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

Daniel Sun reassigned GROOVY-8609:
--

Assignee: Daniel Sun

> Fails to compile when upper bound has generics
> --
>
> Key: GROOVY-8609
> URL: https://issues.apache.org/jira/browse/GROOVY-8609
> Project: Groovy
>  Issue Type: Bug
>  Components: Static compilation, Static Type Checker
>Affects Versions: 2.6.0-alpha-3, 3.0.0-alpha-2, 2.5.0
>Reporter: Daniel Sun
>Assignee: Daniel Sun
>Priority: Major
>
> Fails to compile the following code:
> {code:java}
> @groovy.transform.CompileStatic
> public class A, E extends Map> {
> E getFirstRecord(T recordList) {
> return recordList.get(0);
> }
> }
> {code}
> *Error messages:*
> {code:java}
> BUG! exception in phase 'instruction selection' in source unit 
> 'ConsoleScript0' Expected earlier checking to detect generics parameter arity 
> mismatch
> Expected: java.util.Map 
> Supplied: java.util.Map 
>   at 
> org.codehaus.groovy.ast.tools.GenericsUtils.extractPlaceholders(GenericsUtils.java:169)
>   at 
> org.codehaus.groovy.ast.tools.GenericsUtils.extractPlaceholders(GenericsUtils.java:142)
>   at 
> org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.compareGenericsWithBound(GenericsType.java:375)
>   at 
> org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.checkGenerics(GenericsType.java:307)
>   at 
> org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.matches(GenericsType.java:276)
>   at 
> org.codehaus.groovy.ast.GenericsType.isCompatibleWith(GenericsType.java:198)
>   at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkTypeGenerics(StaticTypeCheckingVisitor.java:1174)
>   at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkReturnType(StaticTypeCheckingVisitor.java:2076)
>   at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor$1.returnStatementAdded(StaticTypeCheckingVisitor.java:309)
>   at 
> org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitReturnStatement(StaticTypeCheckingVisitor.java:2026)
>   at 
> org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:49)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (GROOVY-8610) STC NPE using DGM collect on Iterator

2018-05-27 Thread John Wagenleitner (JIRA)

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

John Wagenleitner updated GROOVY-8610:
--
Priority: Minor  (was: Major)

> STC NPE using DGM collect on Iterator
> -
>
> Key: GROOVY-8610
> URL: https://issues.apache.org/jira/browse/GROOVY-8610
> Project: Groovy
>  Issue Type: Bug
>  Components: Static Type Checker
>Affects Versions: 2.5.0
>Reporter: John Wagenleitner
>Assignee: John Wagenleitner
>Priority: Minor
>
> {code:groovy}
> @groovy.transform.TypeChecked
> def m() {
> List list = ['foo', 'bar', 'baz']
> list.iterator().collect { it.startsWith('ba') } == [false, true, true]
> }
> m()
> {code}
> Results in: 
> {code:java}
> BUG! exception in phase 'instruction selection' in source unit 
> 'TestScript.groovy' unexpected NullpointerException
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (GROOVY-8610) STC NPE using DGM collect on Iterator

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492156#comment-16492156
 ] 

ASF GitHub Bot commented on GROOVY-8610:


Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/729


> STC NPE using DGM collect on Iterator
> -
>
> Key: GROOVY-8610
> URL: https://issues.apache.org/jira/browse/GROOVY-8610
> Project: Groovy
>  Issue Type: Bug
>  Components: Static Type Checker
>Affects Versions: 2.5.0
>Reporter: John Wagenleitner
>Assignee: John Wagenleitner
>Priority: Major
>
> {code:groovy}
> @groovy.transform.TypeChecked
> def m() {
> List list = ['foo', 'bar', 'baz']
> list.iterator().collect { it.startsWith('ba') } == [false, true, true]
> }
> m()
> {code}
> Results in: 
> {code:java}
> BUG! exception in phase 'instruction selection' in source unit 
> 'TestScript.groovy' unexpected NullpointerException
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] groovy pull request #729: GROOVY-8610: STC NPE using DGM collect on Iterator

2018-05-27 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/groovy/pull/729


---


[jira] [Commented] (GROOVY-8610) STC NPE using DGM collect on Iterator

2018-05-27 Thread John Wagenleitner (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492127#comment-16492127
 ] 

John Wagenleitner commented on GROOVY-8610:
---

Stacktrace
{code:java}
BUG! exception in phase 'instruction selection' in source unit 
'TestScripttestDGM_collectOnIterator0.groovy' unexpected NullpointerException

at 
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1092)
at 
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:631)
at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:609)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:586)


Caused by: java.lang.NullPointerException
at org.codehaus.groovy.ast.GenericsType.(GenericsType.java:50)
at org.codehaus.groovy.ast.GenericsType.(GenericsType.java:58)
at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.resolveGenericsFromTypeHint(StaticTypeCheckingVisitor.java:2825)
at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.doInferClosureParameterTypes(StaticTypeCheckingVisitor.java:2746)
at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.inferClosureParameterTypes(StaticTypeCheckingVisitor.java:2591)
at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallArguments(StaticTypeCheckingVisitor.java:2556)
at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitMethodCallExpression(StaticTypeCheckingVisitor.java:3254)
at 
org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)

{code}

> STC NPE using DGM collect on Iterator
> -
>
> Key: GROOVY-8610
> URL: https://issues.apache.org/jira/browse/GROOVY-8610
> Project: Groovy
>  Issue Type: Bug
>  Components: Static Type Checker
>Affects Versions: 2.5.0
>Reporter: John Wagenleitner
>Assignee: John Wagenleitner
>Priority: Major
>
> {code:groovy}
> @groovy.transform.TypeChecked
> def m() {
> List list = ['foo', 'bar', 'baz']
> list.iterator().collect { it.startsWith('ba') } == [false, true, true]
> }
> m()
> {code}
> Results in: 
> {code:java}
> BUG! exception in phase 'instruction selection' in source unit 
> 'TestScript.groovy' unexpected NullpointerException
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] groovy pull request #729: GROOVY-8610: STC NPE using DGM collect on Iterator

2018-05-27 Thread jwagenleitner
GitHub user jwagenleitner opened a pull request:

https://github.com/apache/groovy/pull/729

GROOVY-8610: STC NPE using DGM collect on Iterator



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jwagenleitner/groovy 8610-stc-collect-iterator

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/729.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #729


commit 137f87a3809e3d8d8f572b07f464237f3277b0b2
Author: John Wagenleitner 
Date:   2018-05-27T19:10:59Z

GROOVY-8610: STC NPE using DGM collect on Iterator




---


[jira] [Commented] (GROOVY-8610) STC NPE using DGM collect on Iterator

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/GROOVY-8610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492129#comment-16492129
 ] 

ASF GitHub Bot commented on GROOVY-8610:


GitHub user jwagenleitner opened a pull request:

https://github.com/apache/groovy/pull/729

GROOVY-8610: STC NPE using DGM collect on Iterator



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jwagenleitner/groovy 8610-stc-collect-iterator

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/groovy/pull/729.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #729


commit 137f87a3809e3d8d8f572b07f464237f3277b0b2
Author: John Wagenleitner 
Date:   2018-05-27T19:10:59Z

GROOVY-8610: STC NPE using DGM collect on Iterator




> STC NPE using DGM collect on Iterator
> -
>
> Key: GROOVY-8610
> URL: https://issues.apache.org/jira/browse/GROOVY-8610
> Project: Groovy
>  Issue Type: Bug
>  Components: Static Type Checker
>Affects Versions: 2.5.0
>Reporter: John Wagenleitner
>Assignee: John Wagenleitner
>Priority: Major
>
> {code:groovy}
> @groovy.transform.TypeChecked
> def m() {
> List list = ['foo', 'bar', 'baz']
> list.iterator().collect { it.startsWith('ba') } == [false, true, true]
> }
> m()
> {code}
> Results in: 
> {code:java}
> BUG! exception in phase 'instruction selection' in source unit 
> 'TestScript.groovy' unexpected NullpointerException
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (GROOVY-8610) STC NPE using DGM collect on Iterator

2018-05-27 Thread John Wagenleitner (JIRA)

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

John Wagenleitner reassigned GROOVY-8610:
-

Assignee: John Wagenleitner

> STC NPE using DGM collect on Iterator
> -
>
> Key: GROOVY-8610
> URL: https://issues.apache.org/jira/browse/GROOVY-8610
> Project: Groovy
>  Issue Type: Bug
>  Components: Static Type Checker
>Affects Versions: 2.5.0
>Reporter: John Wagenleitner
>Assignee: John Wagenleitner
>Priority: Major
>
> {code:groovy}
> @groovy.transform.TypeChecked
> def m() {
> List list = ['foo', 'bar', 'baz']
> list.iterator().collect { it.startsWith('ba') } == [false, true, true]
> }
> m()
> {code}
> Results in: 
> {code:java}
> BUG! exception in phase 'instruction selection' in source unit 
> 'TestScript.groovy' unexpected NullpointerException
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (GROOVY-8610) STC NPE using DGM collect on Iterator

2018-05-27 Thread John Wagenleitner (JIRA)
John Wagenleitner created GROOVY-8610:
-

 Summary: STC NPE using DGM collect on Iterator
 Key: GROOVY-8610
 URL: https://issues.apache.org/jira/browse/GROOVY-8610
 Project: Groovy
  Issue Type: Bug
  Components: Static Type Checker
Affects Versions: 2.5.0
Reporter: John Wagenleitner


{code:groovy}
@groovy.transform.TypeChecked
def m() {
List list = ['foo', 'bar', 'baz']
list.iterator().collect { it.startsWith('ba') } == [false, true, true]
}

m()
{code}

Results in: 

{code:java}
BUG! exception in phase 'instruction selection' in source unit 
'TestScript.groovy' unexpected NullpointerException
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (GROOVY-8609) Fails to compile when upper bound has generics

2018-05-27 Thread Daniel Sun (JIRA)
Daniel Sun created GROOVY-8609:
--

 Summary: Fails to compile when upper bound has generics
 Key: GROOVY-8609
 URL: https://issues.apache.org/jira/browse/GROOVY-8609
 Project: Groovy
  Issue Type: Bug
  Components: Static compilation, Static Type Checker
Affects Versions: 2.5.0, 3.0.0-alpha-2, 2.6.0-alpha-3
Reporter: Daniel Sun


Fails to compile the following code:

{code:java}
@groovy.transform.CompileStatic
public class A, E extends Map> {
E getFirstRecord(T recordList) {
return recordList.get(0);
}
}
{code}

*Error messages:*
{code:java}
BUG! exception in phase 'instruction selection' in source unit 'ConsoleScript0' 
Expected earlier checking to detect generics parameter arity mismatch
Expected: java.util.Map 
Supplied: java.util.Map 

at 
org.codehaus.groovy.ast.tools.GenericsUtils.extractPlaceholders(GenericsUtils.java:169)

at 
org.codehaus.groovy.ast.tools.GenericsUtils.extractPlaceholders(GenericsUtils.java:142)

at 
org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.compareGenericsWithBound(GenericsType.java:375)

at 
org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.checkGenerics(GenericsType.java:307)

at 
org.codehaus.groovy.ast.GenericsType$GenericsTypeMatcher.matches(GenericsType.java:276)

at 
org.codehaus.groovy.ast.GenericsType.isCompatibleWith(GenericsType.java:198)

at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkTypeGenerics(StaticTypeCheckingVisitor.java:1174)

at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.checkReturnType(StaticTypeCheckingVisitor.java:2076)

at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor$1.returnStatementAdded(StaticTypeCheckingVisitor.java:309)

at 
org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitReturnStatement(StaticTypeCheckingVisitor.java:2026)

at 
org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:49)

{code}






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)