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