[jira] [Commented] (GROOVY-7812) Static inner classes cannot be accessed from other files when running by 'groovy' command

2019-01-12 Thread Daniel Sun (JIRA)


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

Daniel Sun commented on GROOVY-7812:


Fixed just now, but I want to tweak the PR later. It is too late for me to 
sleep(03:36 a.m now)...

> Static inner classes cannot be accessed from other files when running by 
> 'groovy' command
> -
>
> Key: GROOVY-7812
> URL: https://issues.apache.org/jira/browse/GROOVY-7812
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.6
>Reporter: Nikolay Chashnikov
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Create the following files
> {code:title=Outer.groovy}
> class Outer {
>   static class Inner {
>   }
> }
> {code}
> {code:title=Main.groovy}
> println new Outer()
> println new Outer.Inner()
> {code}
> and run 'groovy Main.groovy'. It'll fail with the following message:
> {quote}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> /home/.../Main.groovy: 2: unable to resolve class Outer.Inner 
>  @ line 2, column 9.
>println new Outer.Inner()
> {quote}



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


[GitHub] danielsun1106 opened a new pull request #853: GROOVY-7812: Static inner classes cannot be accessed from other files…

2019-01-12 Thread GitBox
danielsun1106 opened a new pull request #853: GROOVY-7812: Static inner classes 
cannot be accessed from other files…
URL: https://github.com/apache/groovy/pull/853
 
 
   … when running by 'groovy' command


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (GROOVY-7812) Static inner classes cannot be accessed from other files when running by 'groovy' command

2019-01-12 Thread Daniel Sun (JIRA)


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

Daniel Sun commented on GROOVY-7812:


Though I can fix the sample code, it's quite hard to iron out all wrinkles... 
I've debugged for hours... 

> Static inner classes cannot be accessed from other files when running by 
> 'groovy' command
> -
>
> Key: GROOVY-7812
> URL: https://issues.apache.org/jira/browse/GROOVY-7812
> Project: Groovy
>  Issue Type: Bug
>  Components: Compiler
>Affects Versions: 2.4.6
>Reporter: Nikolay Chashnikov
>Priority: Major
>
> Create the following files
> {code:title=Outer.groovy}
> class Outer {
>   static class Inner {
>   }
> }
> {code}
> {code:title=Main.groovy}
> println new Outer()
> println new Outer.Inner()
> {code}
> and run 'groovy Main.groovy'. It'll fail with the following message:
> {quote}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> /home/.../Main.groovy: 2: unable to resolve class Outer.Inner 
>  @ line 2, column 9.
>println new Outer.Inner()
> {quote}



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


[jira] [Created] (GROOVY-8956) conditional if/else has issues with evaluated strings in maps

2019-01-12 Thread Owen Rubel (JIRA)
Owen Rubel created GROOVY-8956:
--

 Summary: conditional if/else has issues with evaluated strings in 
maps
 Key: GROOVY-8956
 URL: https://issues.apache.org/jira/browse/GROOVY-8956
 Project: Groovy
  Issue Type: Bug
  Components: groovy-jdk
Affects Versions: 2.5.5, 2.5.4, 2.5.2, 2.5.0
 Environment: Ubuntu, Sun Java 8
Reporter: Owen Rubel


I was converting an if/else to a conditional and had the following error:

class org.codehaus.groovy.ast.expr.TernaryExpression, with its value 
'((codeTotals[$it[1]] == null)) ? 0 : codeTotals[$it[1]]', is a bad expression 
as the left hand side of an assignment operator at line: 50 column: 87. 



My if/else (which works)is as follows:

if(codeTotals["${it[1]}"]==null){
 codeTotals["${it[1]}"] = 0
}else{
 codeTotals["${it[1]}"] += 1
}

 

... VS the  logical conditional (which throws the error):

codeTotals["${it[1]}"] = (codeTotals["$it[1]"] == null) ? 0 : 
codeTotals["$it[1]"] +=1

 

Right now I am just trying to test some features but I thought this was weird 
enough to mention since a logical should work the same regardless of variable.

 



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