Merge pull request #3769 from evincarofautumn/fix-verify-before-allocs
[mono.git] / mcs / errors / cs1654-4.cs
1 // CS1654: Cannot assign to members of `f' because it is a `using variable'
2 // Line: 22
3
4 using System;
5
6 struct Foo : IDisposable
7 {
8         public int this[int arg] {
9                 set { }
10         }
11
12         public void Dispose ()
13         {
14         }
15 }
16
17 class Bar
18 {
19         static void Main ()
20         {
21                 using (var f = new Foo ()) {
22                         f[0] = 1;
23                 }
24         }
25 }