throw an exception when the instance doesn't match the type
separation logic examples started