C#: Add test

This commit is contained in:
Calum Grant
2019-12-27 11:44:39 +00:00
parent 7e84453ec9
commit fd0225ca59
2 changed files with 13 additions and 1 deletions

View File

@@ -259,7 +259,7 @@ public class Captured
fn(() =>
{
var x = y; // BAD: Dead store in lambda
return 0;
return 0;
});
}
@@ -425,3 +425,14 @@ class Finally
return i;
}
}
public static class AnonymousVariable
{
public static int Count<T>(this IEnumerable<T> items)
{
int count = 0;
foreach (var _ in items)
count++;
return count;
}
}