History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-985
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Cedric Vivier
Reporter: Cedric Vivier
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Allow arithmetic operations with nullables

Created: 04/Apr/08 03:28 PM   Updated: 19/May/08 08:58 AM
Component/s: None
Affects Version/s: 0.8.1
Fix Version/s: 0.8.2

Time Tracking:
Not Specified

Issue Links:
Supercedes
 

Testcase included: yes


 Description  « Hide
na as int? = 30
nb as int? = 12
nn as int? #no value
no as int?
c = 42

assert c == na+nb
assert null == na+nn
try:
c = na+nn
except InvalidOperationException:
print "an nullable arithmetic with one operand without value cannot be cast to an non-nullable"

na *= 2
assert 60 == na



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Cedric Vivier - 06/Apr/08 08:48 AM - edited
partially fixed in rev. 2901

testcase is net2/generics/nullable-3.boo

arithmetic works when all nullables have value.
need to add some temp locals and HasValue tests to handle mixed null/value ops.
(will also optimize nullable==non-null-value tests)


Cedric Vivier - 19/May/08 08:58 AM
fixed in rev. 2960