GROOVY-6811: Fix anonymous inner class when it extends a non static inner class