마지막으로 작동하지 않는 이유를 아는 사람이 있습니까?Null 병합 연산자가 주어짐 지정된 캐스트가 유효하지 않습니다 short int
object nullObj = null;
short works1 = (short) (nullObj ?? (short) 0);
short works2 = (short) (nullObj ?? default(short));
short works3 = 0;
short wontWork = (short) (nullObj ?? 0); //Throws: Specified cast is not valid
[대표 및 신원] (http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx)에서는 왜 이것이 필요한지 설명합니다 (즉, 왜 isn 오직 1 회 던지기만으로 자동으로 완료됩니다.) – Brian