summaryrefslogtreecommitdiff
path: root/mcs/errors/cs1654-3.cs
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/errors/cs1654-3.cs')
-rw-r--r--mcs/errors/cs1654-3.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/mcs/errors/cs1654-3.cs b/mcs/errors/cs1654-3.cs
new file mode 100644
index 0000000000..c49e6875dd
--- /dev/null
+++ b/mcs/errors/cs1654-3.cs
@@ -0,0 +1,25 @@
+// CS1654: Cannot assign to members of `f' because it is a `using variable'
+// Line: 22
+
+using System;
+
+struct Foo : IDisposable
+{
+ public int Property {
+ set { }
+ }
+
+ public void Dispose ()
+ {
+ }
+}
+
+class Bar
+{
+ static void Main ()
+ {
+ using (var f = new Foo ()) {
+ f.Property = 0;
+ }
+ }
+} \ No newline at end of file