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

Commented 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.
Comments: Fixed in [Version 5.3.5](https://clearscript.codeplex.com/SourceControl/changeset/f961ab5a428cd1b6ffa92c9c4c7c35a9f3322a2c).

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>