I've tried
module Program
{
Main() : void
{ mutable x : byte = 0B;
mutable y : byte = 0B;
x++;
//y = x + 1;
//y = x + 1B;
//def one:byte=1;// x = x + one;
}
}
No matter which one I try, I get the following error message.
Error 1 expected byte, got int in assigned value: System.Int32 is not a subtype of System.Byte [simple require]
Only way I've found that works is
y = ( x + 1 ):>byte
Which is bit of faff, just to add one.
Why is this? and Is there a better (read shorter way)?
byte + int
? What ofbyte + byte
? C# is similar:byte x = 0; x = x + 1
will also not compile. (C# will actually work okay withx += 1
andx++
, but it may be the case that these are expanded in nemerle.) – Nitrebyte + byte
is the unexpected return type of an int – Kendre