ajwang / groovypptest

Automatically exported from code.google.com/p/groovypptest
0 stars 0 forks source link

Compilation issues with Grails plugin #319

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The output during compilation is:

  [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  [groovyc] /Users/pledbrook/dev/tools/git/grails-samples/grails.org/grails-app/controllers/org/grails/ContentController.groovy: 201: Cannot find super constructor groovy.lang.Closure
  [groovyc]  @ line 201, column 52.
  [groovyc]    mplate:"/shared/remoteError", [code:"pag
  [groovyc]                                  ^
  [groovyc] 
  [groovyc] /Users/pledbrook/dev/tools/git/grails-samples/grails.org/grails-app/controllers/org/grails/plugin/PluginController.groovy: 326: Non-static property name
  [groovyc]  @ line 326, column 16.
  [groovyc]            plugin."$name" = new WikiPage(title:name, body:params."$name")
  [groovyc]                   ^
  [groovyc] 
  [groovyc] 2 errors
Compilation error: Compilation Failed

The first error is around this code:

    def editWikiPage = {
        if(!params.id) {
            render(template:"/shared/remoteError", [code:"page.id.missing"])
        }

The second error is around:

    private def pluginWiki(name, plugin, params) {
        plugin."$name" = new WikiPage(title:name, body:params."$name")
    }

Original issue reported on code.google.com by p.ledbr...@gmail.com on 25 Nov 2010 at 11:42

GoogleCodeExporter commented 8 years ago
Seems like there are two separate issues:
1) compiler expects Closure but find map expression

2) non-static property names, which is not supported yet

Original comment by alex.tka...@gmail.com on 11 Dec 2010 at 3:32

GoogleCodeExporter commented 8 years ago
In fact, in mixed mode non-static property names already supported

Original comment by alex.tka...@gmail.com on 11 Dec 2010 at 3:35

GoogleCodeExporter commented 8 years ago
1) This was due to this line:

    render(template:"/shared/remoteError", [code:"page.id.missing"])

which should have been:

    render(template:"/shared/remoteError", model: [code:"page.id.missing"])

However, the error messages leaves something to be desired :) 

Original comment by p.ledbr...@gmail.com on 11 Dec 2010 at 8:49

GoogleCodeExporter commented 8 years ago
Agree that error message is not good and require improvement. I leave issue 
open to keep it on radar.

Is problem 2)  resolved for you?

Original comment by alex.tka...@gmail.com on 11 Dec 2010 at 8:55

GoogleCodeExporter commented 8 years ago
Seem to have a different issue. See attached project.

Original comment by p.ledbr...@gmail.com on 12 Dec 2010 at 8:03

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed in 0.4.98

Original comment by alex.tka...@gmail.com on 12 Dec 2010 at 9:05

GoogleCodeExporter commented 8 years ago
This issue seems to be resolved now, thanks.

Original comment by p.ledbr...@gmail.com on 12 Dec 2010 at 10:31