type switch