This is a bug: currently type check for a non-prototyped record/union translated to an invalid instanceof test. Give an error on these type checks.

If the type check is actually an union case check for an erased union, analyze if it is the only case where the prototype is Object, translate to that check or else give a compilation error.