File tree Expand file tree Collapse file tree
main/java/org/codehaus/groovy/classgen
test/groovy/gls/innerClass Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1465,15 +1465,8 @@ public void visitVariableExpression(final VariableExpression expression) {
14651465 } else {
14661466 PropertyExpression pexp = thisPropX (/*implicit-this*/ true , expression .getName ());
14671467 pexp .getProperty ().setSourcePosition (expression );
1468- pexp .setType (expression .getType ());
14691468 pexp .copyNodeMetaData (expression );
14701469 pexp .visit (this );
1471-
1472- if (!compileStack .isLHS () && !expression .isDynamicTyped ()) {
1473- ClassNode variableType = controller .getTypeChooser ()
1474- .resolveType (expression , controller .getClassNode ());
1475- controller .getOperandStack ().doGroovyCast (variableType );
1476- }
14771470 }
14781471
14791472 if (!compileStack .isLHS ()) {
Original file line number Diff line number Diff line change @@ -2429,9 +2429,33 @@ final class InnerClassTest {
24292429 '''
24302430 }
24312431
2432- // GROOVY-9618
2432+ // GROOVY-11875
24332433 @Test
24342434 void testNestedPropertyHandling6 () {
2435+ assertScript ''' import java.util.concurrent.atomic.AtomicBoolean
2436+ class Outer {
2437+ private AtomicBoolean foo = [true]
2438+ boolean isFoo() {
2439+ foo.get()
2440+ }
2441+ Boolean bar() {
2442+ def i = new Inner()
2443+ i.baz()
2444+ }
2445+ class Inner {
2446+ def baz() {
2447+ foo
2448+ }
2449+ }
2450+ }
2451+
2452+ assert new Outer().bar()
2453+ '''
2454+ }
2455+
2456+ // GROOVY-9618
2457+ @Test
2458+ void testNestedPropertyHandling7 () {
24352459 assertScript '''
24362460 class Super {
24372461 public static X = 1
You can’t perform that action at this time.
0 commit comments