Skip to content

Instantly share code, notes, and snippets.

using System;
namespace ReSharperBugs
{
internal class Program
{
private static void Main()
{
var sideEffectOccurred = false;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public static class C {
public static void M(object[] items) {
var cancelableItems = items.Cast<dynamic>()
.Where(d => d.CanCancel())
.ToArray();
using System;
public class C {
public void M() {
dynamic n;
dynamic c = "";
//
// Roslyn marks use of 'n' in 'n > 0' as possibly unassigned;
// compiles fine with csc.exe in VS2013.
@mstrobel
mstrobel / Program.cs
Last active December 19, 2021 13:08
DynamicObject wrapping IDataRecord and implementing ICustomTypeDescriptor. In response to this StackOverflow question: http://stackoverflow.com/questions/21256655/convert-ienumerabledynamic-to-datatable
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Dynamic;
using System.Linq;
using System.Xml;
namespace DynamicDescriptor
{
@mstrobel
mstrobel / gist:3180488
Created July 26, 2012 05:56
So much evil...
using System;
namespace Evil
{
internal static class Program
{
private static void Main(string[] args)
{
Evil x;
MoreEvil y;