Type '<typename>' must define operator '<determinantoperator>' to be used in a '<shortcircuitoperator>' expression
An AndAlso Operator or an OrElse Operator uses operands of a class or structure type, when that class or structure does not define a required operator.
Because you do not define a short-circuiting operator (AndAlso
or OrElse
) directly, you must define the corresponding logical and determinant operators. The following table shows the required operators.
Short-circuiting operator | Logical operator | Determinant operator |
---|---|---|
AndAlso |
And Operator | IsFalse Operator |
OrElse |
Or Operator | IsTrue Operator |
Visual Basic uses these logical and determinant operators to construct the short-circuiting logic for AndAlso
or OrElse
. For this to work properly, both operands and the return value of your And
or Or
definition must be of the containing type, that is, the type of the class or structure in which you are defining And
or Or
.
Error ID: BC33035
- Define the
And
andIsFalse
operators, or theOr
andIsTrue
operators, in the class or structure used for the operand type of theAndAlso
orOrElse
operator. Be sure the operands forAnd
orOr
are of the type of the class or structure in which you define it.
.NET feedback
.NET is an open source project. Select a link to provide feedback: