https://bugzilla.novell.com/show_bug.cgi?id=359789
Summary: mcs/gmcs treat & like &&
Product: Mono: Compilers
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
mcs and gmcs treat the boolean logical operator & like the boolean conditional
logical operators &&.
The C# spec however requires that both arguments are evaluated for & (see
14.10.3 and 14.11) which is what csc does.
The | operator is treated correctly.
Test programm:
public class M {
public static bool g() {
System.Console.WriteLine ("A");
return false;
}
public static void Main() {
System.Console.WriteLine (false & g());
System.Console.WriteLine (true | g());
}
}
Output when compiled with mcs/gmcs:
False
A
True
Output when compiled with csc:
A
False
A
True
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs