For the last assignment, the code below:
static void Main(string[] args) { int a = 5; object b = 5; System.Diagnostics.Debug.Assert( a is int && b is int ); double x = (double)a; double y = (double)b; }
If both a and b are int
, what is the cause of this error?
source share