integrated type assertion into switch