Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Edited Feature: .NET enum members do not support script-native equality comparison [15]

0
0
.NET enum members cannot be compared natively in script code; `Object.Equals()` must be used instead. Strictly speaking, this isn't a bug; script-native equality comparison is effectively comparison by (boxed) reference. However, it just doesn't seem right that `(DayOfWeek.Monday == DayOfWeek.Monday)` evaluates to `false`. In addition, without script-native comparison support, .NET enum members cannot be used in script `switch` statements, and that's worth fixing.

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images