package com.mycode.testflows

import com.mycode.compiler.TestPopper

class TestingClosure {

    static class MyClassDefinedInGroovy {
        String map
    }

    void process1() {
        def a = new TestPopper.MyTestClass().tap {
            // In 3.0.5, "1234" gets visited twice
            it.map = "1234"

            // In 3.0.5, "12345" gets visited once
            map = "12345"
        }
        // In 3.0.5, "123456" gets visited twice
        a.map = "123456"

        // Everything below here is fine, consistent and as expected visited only once
        def b = new MyClassDefinedInGroovy().tap {
            it.map = "5678"
            map = "56789"
        }
        b.map = "567890"
    }
}
