I wanted to make a sub that manipulated nullables. The idea is for it to take in any nullable variable, and if it has a value, then overwrite a different value. Here is what I wrote:
Dim a as int? = 0
Dim b as int? = 1
Sub ApplyChange(Byref Old As Nullable, ByRef Change as Nullable)
If Change.HasValue Then
Old = Change
End IF
End Sub
ApplyChange(a, b)
The problem is, I get an error '"HasValue is not a member of Nullable' and 'int? cannot be converted to Nullable'. What's going on here? How do I go about making a sub that accepts only nullables?