How is it possible to have an ambiguous reference between the same things?

I’m programming in Unity’s Javascript. I tend to avoid MonoDevelop, but I need to actually use the debugger, and my project which compiles & runs just fine in the editor is choking on a single line.

 public var registry:Dictionary.<String, HashSet.<Vector3> > = new Dictionary.<String, HashSet.<Vector3> >();

The error it’s throwing out is:

/Users/greay/projs/Random/Assets/Scripts/Tile Mapping/TileController.js(49,49): Error BCE0004: Ambiguous reference ‘HashSet’: System.Collections.Generic.HashSet., System.Collections.Generic.HashSet… (BCE0004) (Assembly-UnityScript)

What the hell? For one, how can it be an ambiguous reference between X and X? And why does Unity have absolutely no problem with it, but MonoDevelop does?

[2714-ambiguous.zip|2714]

I was running into the same issue in MonoDevelop. I ended up deriving from HashSet in a c# script in the plugins directory like this:

public class StringSet : System.Collections.Generic.HashSet<string>{}

and then in my javascript file I was then able to have this without the error:

private var mKeys : StringSet;

Hope this helps!

Using the following in an empty javascript script worked just fine:

import  System.Collections.Generic;
public var registry:Dictionary.<String, HashSet.<Vector3> > = new Dictionary.<String, HashSet.<Vector3> >();

Likely problem is something similar to this post.