Here's an interesting puzzle.
I downloaded Snippet Compiler to try some stuff out, and wanted to write the following code:
using System;
using System.Collections.Generic;
public class MyClass
{
public static void RunSnippet()
{
HashSet<int> h = new HashSet<int>();
}
}
But the above code doesn't compile. I get:
"The type or namespace name 'HashSet' could not be found (are you missing a using directive or an assembly reference?)"
Clearly I'm not. It seems it can't find HashSet, yet it finds other types in the Systems.Collections.Generic namespace (e.g. List, SortedDictionary).
What's the explanation for this? Presumeably Snippet Compiler is just using the standard Framework compiler under the covers...
I would be interested to know why this doesn't work.