GROOVY-6961: fix wrong generics type extraction for extension methods by using the custom declared class instead of backing node