When I try and set a nullable Decimal to zero I get the below error.  I did notice that if I parse the zero to a decimal it does work.

COBCH1624: cannot implicitly convert binary-char to type System.Nullable[Decimal]. 

01  testDecimal type Nullable[type Decimal] property.

method-id New

procedure division.

         set testDecimal to 0.

end method

Is this a problem with the compiler?  It seems that this code should work.


  • Verified Answer

    The compiler does not currently have any specific support for nullable types, though this could certainly be a useful enhancement.  It does have support for the use of implicit and explicit conversions and System.Nullable<T> defines an implicit conversion from type T to System.Nullable<T>.  This means that you can replace the set statement in your example by:

            set testDecimal to 0 as decimal

    ...and the correct conversion code will be generated.

    I will investigate better support for nullable types for a future compiler release.