use switch.(type) instead