Sytone's Ramblings

The occasional posts of a guy who plays with technology.

When is true not true?

2010-05-31 1 min read General

When you look at true stored in the .Net framework. While playing with Pex I found out a interesting fact that the bool is a byte in the MSIL. Which means that a bool could be euqal to anything on the byte range… Now this would require you to go out of your way and create unsafe code blocks to do this. Why you would do this… No ideas :) Its marked as a no-fix which is not supprising as I would not fix it either becase as they say, if you know about this and you use it then you are on your own.. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=455553&wa=wsignin1.0 http://blog.dotnetwiki.org/2009/05/29/TamingThePexBeastWellbehavedEnumsMultidimensionalArraysAndBooleans.aspx