File tree Expand file tree Collapse file tree
src/main/java/org/codehaus/groovy/transform/stc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5241,14 +5241,12 @@ protected ClassNode getType(final ASTNode node) {
52415241 }
52425242 if (variable instanceof Parameter ) {
52435243 Parameter parameter = (Parameter ) variable ;
5244- // check if param part of control structure - but not if inside instanceof
5245- List <ClassNode > temporaryTypesForExpression = getTemporaryTypesForExpression (vexp );
5246- if (temporaryTypesForExpression == null || temporaryTypesForExpression .isEmpty ()) {
5244+ if (getTemporaryTypesForExpression (vexp ).isEmpty ()) { // not instanceof
5245+ // check if the parameter is part of a control structure (for loop)
52475246 type = typeCheckingContext .controlStructureVariables .get (parameter );
5248- }
5249- // now check for closure override
5250- if (type == null && temporaryTypesForExpression == null ) {
5251- type = getTypeFromClosureArguments (parameter );
5247+ if (type == null ) { // else check closure metadata
5248+ type = getTypeFromClosureArguments (parameter );
5249+ }
52525250 }
52535251 if (type != null ) {
52545252 storeType (vexp , type );
You can’t perform that action at this time.
0 commit comments