[mono-vb] Bug in Boolean operators

Jan Bodnar vronskij at gmail.com
Tue Aug 24 17:40:15 EDT 2010


Hi,

I have bumped into an error in VB compiler. 

True And False gives True
False And True gives True

which is wrong. This applies for Or and Xor as well. 

Running the below example gives:
$ ./bools.exe 
True
True
True
False

I am using Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)

Jan Bodnar

Option Strict On


Module Example

    Dim a As Boolean
    Dim b As Boolean
    Dim c As Boolean
    Dim d As Boolean

    Sub Main

        a = (True And True)
        b = (True And False)
        c = (False And True)
        d = (False And False)

        Console.WriteLine(a)
        Console.WriteLine(b)
        Console.WriteLine(c)
        Console.WriteLine(d)

    End Sub

End Module

-- 
View this message in context: http://mono.1490590.n4.nabble.com/Bug-in-Boolean-operators-tp2337395p2337395.html
Sent from the Mono - VB mailing list archive at Nabble.com.


More information about the Mono-vb mailing list