Type mismatch, cannot assign "nullable Int32" to "Integer/Double

I think this should work without causing any error:

dec(a,l:Count);

I attached project and screenshot.
Bug191.rar (139.6 KB)

Best regards,
Jose A.

Hm, no? This needs a valueOrDefault(). else, how much woudit increment if l is nil?

Marc,
This type of code we had used previously and we believe that it was working properly.
Supposedly “:” should serve to reduce the code necessary to control a nil value.

Like the previous, this code does not work properly:
var l: TList := nil;
var a: TInteger;
a := 1 - l:Count;

a return 0.

Do you think this is normal?
If this works this way, it has a very relative usefulness, and their use can lead to many errors in the code.

I attached project and screenshot of the new problem.
Bug192.rar (200.9 KB)

Best regards,
Jose A.

no, : is what CREATES the nullable value. you cannot pass a nullable value where a non-nil value is expected.thsi is as designed, if 8.1 allowed the, that was a bug in 8.1.

This problem we have found in 8.1, do not know how version 8.2 will behave.
We can not use version 8.2 until these errors are corrected:

http://talk.remobjects.com/t/strange-errors-with-the-latest-version-8-2/6569

http://talk.remobjects.com/t/problem-with-mapped-array-property-new-version-8-2/6568

Thanks,
Best regards,
Jose A.

Ok,but that’s entirely unrelated, and the two issues are logged, right? Carlo will look at them when he’s back from vacation.

It was just a comment about what you had said about version 8.1. We continue to work with this version, so this problem we’re having is with the latest version 8.1. No problem with bugs correction.
We understand the limitations of “:”.
I hope you’re having a great summer. :grinning: :speedboat:

Best regards,
Jose A.