Details
Description
Building parent AND child from same script at different scopes gives groovy compilation error.
Building only one does not.
nano = builder.container(parent:parent, scope:assemblyScope) {
if ( assemblyScope instanceof ParentAssemblyScope )
else if ( assemblyScope instanceof SomeAssemblyScope ){
component(B)
}
}
See GroovyNodeBuilderTestCase#testBuildContainerWithParentAndChildAssemblyScopes()
Activity

Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Won't Fix [ 2 ] |

Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee | Paul Hammant [ paul ] |
That's because that is not how Groovy works (unless someone corrects me)
nano = builder.container(parent:parent, scope:assemblyScope)
{ component(A) component(B) }is kosher.
nano = builder.container(parent:parent, scope:assemblyScope) {
{ nano.component(A) }}
if ( assemblyScope instanceof ParentAssemblyScope )
else if ( assemblyScope instanceof SomeAssemblyScope )
{ nano.component(B) }is too I suspect.