switch表达式和case条件支持的类型

如果是不支持的类型,则编译时给出如下错误:

A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type

从错误中可以得知支持的类型。

原文地址:https://www.cnblogs.com/qishichang/p/1966584.html