GROOVY-6047: NPE in type checker using an extension