ajwang / groovypptest

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

Multiple assignment in Grails controller causing compile error #322

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have this snippet of code in a Grails controller:

        def currentPlugins = []
        def totalPlugins = 0

        try {
            (currentPlugins, totalPlugins) = pluginService."list${category.capitalize()}PluginsWithTotal"(queryParams)
        }

If the controller has the @Typed annotation, I get the following compilation 
error:

  [groovyc] /Users/pledbrook/dev/tools/git/grails-samples/grails.org/grails-app/controllers/org/grails/plugin/PluginController.groovy: 55: org.codehaus.groovy.ast.expr.TupleExpression cannot be cast to org.mbte.groovypp.compiler.bytecode.BytecodeExpr
  [groovyc]  @ line 55, column 13.
  [groovyc]                (currentPlugins, totalPlugins) = pluginService."list${category.capitalize()}PluginsWithTotal"(queryParams)
  [groovyc]                ^
  [groovyc] 
  [groovyc] 1 error
Compilation error: Compilation Failed

Stack trace attached as file.

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

Attachments:

GoogleCodeExporter commented 8 years ago
BTW, the project is publicly available:

    https://github.com/grails/grails-samples/tree/master/grails.org/

I have tried the @Typed annotation on both ContentController and 
PluginController.

Original comment by p.ledbr...@gmail.com on 26 Nov 2010 at 11:08

GoogleCodeExporter commented 8 years ago
We don't have good way yet to support multiple assignments

Original comment by talex.gv...@gmail.com on 26 Nov 2010 at 11:32

GoogleCodeExporter commented 8 years ago
Issue 324 has been merged into this issue.

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

GoogleCodeExporter commented 8 years ago

Original comment by alex.tka...@gmail.com on 11 Dec 2010 at 2:27

GoogleCodeExporter commented 8 years ago

Original comment by alex.tka...@gmail.com on 11 Dec 2010 at 2:28