BC32128: 'IsNot' operand of type 'typename' can only be compared to 'Nothing', because 'typename' is a nullable type
A variable declared as a nullable value type has been compared to an expression other than Nothing
using the IsNot
operator.
Error ID: BC32128
To correct this error
To compare a nullable type to an expression other than Nothing
by using the IsNot
operator, call the GetType
method on the nullable type and compare the result to the expression, as shown in the following example.
Dim number? As Integer = 5
If number IsNot Nothing Then
If number.GetType() IsNot Type.GetType("System.Int32") Then
End If
End If
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for