[Mono-bugs] [Bug 75946][Min] New - [PATCH] CS0665 not checked for
conditional operator
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Aug 31 11:26:16 EDT 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by atsushi at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=75946
--- shadow/75946 2005-08-31 11:26:16.000000000 -0400
+++ shadow/75946.tmp.24339 2005-08-31 11:26:16.000000000 -0400
@@ -0,0 +1,39 @@
+Bug#: 75946
+Product: Mono: Compilers
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: atsushi at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: [PATCH] CS0665 not checked for conditional operator
+
+mcs reports CS0665 for if statement but not for conditional operator.
+
+class Test
+{
+ public bool Foo (bool x)
+ {
+ bool b;
+ return (b = true) ? true : b;
+ }
+}
+
+Actual Results:
+
+no warning.
+
+Expected Results:
+
+cs0665-2.cs(9,10): warning CS0665: Assignment in conditional expression is
+always constant; did you mean to use == instead of = ?
+
+The fix is attached.
More information about the mono-bugs
mailing list