[ https://issues.apache.org/jira/browse/GROOVY-7670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540667#comment-17540667 ]
Eric Milles commented on GROOVY-7670: ------------------------------------- https://github.com/apache/groovy/commit/2691fb0d2b745a7cc6647edd09a71a3831ffa460 > CLONE - dash in script filename > ------------------------------- > > Key: GROOVY-7670 > URL: https://issues.apache.org/jira/browse/GROOVY-7670 > Project: Groovy > Issue Type: Bug > Components: class generator > Affects Versions: 2.4.5 > Reporter: Christoph Grothaus > Priority: Minor > Labels: ClassFormatError > Attachments: fibonacci-numbers.groovy, fibonacci_numbers.groovy > > > Cannot create script with dash ("-") in filename. > Please try to run the two attached groovy scripts. The one with an underscore > in the filename runs happily (don't wonder, it gives no output). The one with > a dash in the filename gives this error: {noformat}$ groovy > fibonacci-numbers.groovy > Caught: java.lang.ClassFormatError: Illegal class name > "fibonacci-numbers$fib" in class file fibonacci-numbers$fib > java.lang.ClassFormatError: Illegal class name "fibonacci-numbers$fib" in > class file fibonacci-numbers$fib > at fibonacci-numbers.run(fibonacci-numbers.groovy:5){noformat} > It really took me some time to figure out that the dash was causing this. I > would like to see Groovy allowing dashes in script filenames. If that should > be impossible, at least the error message should cleary indicate that I have > used an illegal character in the script filename. -- This message was sent by Atlassian Jira (v8.20.7#820007)