https://bugzilla.novell.com/show_bug.cgi?id=355163
Summary: Pre or post incrementing a nullable property throws
compile error (CS0131)
Product: Mono: Compilers
Version: 1.2.6
Platform: i686
OS/Version: Linux
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
Submitted by Mindtouch
Summary:
When trying to pre or post increment a nullable property, compliation fails
with the following error message:
error CS0131: The left-hand side of an assignment must be a variable, a
property or an indexer
Code Sample:
using System;
namespace BugReport {
class Program {
static void Main(string[] args) {
A a = new A();
a.Counter++; // fails
++a.Counter; // fails
a.Counter = a.Counter + 1; // succeeds
}
}
class A {
private int? _counter;
public int? Counter {
get { return _counter; }
set { _counter = value; }
}
}
}
--
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