Operator '<operator>' must have a return type of Boolean

A comparison or logical operator is declared with a return type other than the Boolean Data Type (Visual Basic).

The result of a comparison operator (=, <>, <, <=, >, >=, Is, IsNot, IsFalse, IsTrue, Like, TypeOf) can be only True or False. For more information, see Comparison Operators in Visual Basic.

Logical operators (And, AndAlso, Not, Or, OrElse, Xor) work entirely within the domain of Boolean values. For more information, see Logical and Bitwise Operators in Visual Basic.

Error ID: BC33023

To correct this error

  • Replace the return type of this comparison or logical operator with Boolean.

See Also

Tasks

How to: Define an Operator

How to: Define a Conversion Operator

Concepts

Operator Procedures

Reference

Operator Statement