An assert statement is missing. And I mean one which checks against the value, not only the type ;)