Created
October 13, 2017 17:08
-
-
Save binki/7d99fa49465257670733e91ed94dcaa7 to your computer and use it in GitHub Desktop.
disposing IEnumerator not allowed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1>------ Build started: Project: Disposable, Configuration: Debug Any CPU ------ | |
1>c:\users\ohnob\AppData\Local\Temp\Disposable\Disposable\Program.cs(13,16,13,59): error CS1674: 'IEnumerator': type used in a using statement must be implicitly convertible to 'System.IDisposable' | |
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
IEnumerable enumerable = new[] | |
{ | |
"a", | |
"b", | |
"c", | |
}; | |
using (var enumerator = enumerable.GetEnumerator()) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment