fix Issue 10259 - ICE on invalid compile-time class instantiation