diff --git a/src/tint/castable.h b/src/tint/castable.h index 05144f79e3..f5d2cb2c6d 100644 --- a/src/tint/castable.h +++ b/src/tint/castable.h @@ -641,8 +641,9 @@ inline void SwitchCases(T* object, std::tuple&& cases) { using Cases = std::tuple; static constexpr int kDefaultIndex = detail::IndexOfDefaultCase(); - static_assert(kDefaultIndex == -1 || std::tuple_size_v - 1, - "Default case must be last in Switch()"); + static_assert( + kDefaultIndex == -1 || kDefaultIndex == std::tuple_size_v - 1, + "Default case must be last in Switch()"); static constexpr bool kHasDefaultCase = kDefaultIndex >= 0; static constexpr bool kHasReturnType = !std::is_same_v;