Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by greay · Aug 05, 2012 at 10:07 PM · javascriptmonodevelopambiguous reference

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?

sample project

ambiguous.zip (237.8 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Bernie_ClutchPlay · Apr 24, 2015 at 04:25 PM

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!

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MariuszKowalczyk · May 13, 2015 at 08:50 AM 0
Share

Thanks, this solution works for me. I had a problem (BCE0004 error) with System.Diagnostics.Process and this helped me.

avatar image greay · May 13, 2015 at 10:41 PM 0
Share

Wow, 2 1/2 years later and I finally have an answer to this!

(granted, this is just a workaround – the error still doesn't make any sense whatsoever. but it'll do)

avatar image
0

Answer by Jerdak · Aug 13, 2012 at 02:59 AM

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.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image greay · Aug 13, 2012 at 07:22 AM 0
Share

Hm. Then I'm doing something very wrong / something weird's going on. Because I tried creating a sample project with only one javascript with just this code in it, and I'm still getting the same error. I've attached the sample project to this question.

  • that post seems to suggest duplicate files as the source of the problem (at least for that guy; I'm familiar with the cause of most "ambiguous reference" problems). I don't think that's what's going on here – there's definitely no duplicate files in this test project.

avatar image Jerdak · Aug 13, 2012 at 02:20 PM 0
Share

For ref., what version of Unity are you using?

avatar image greay · Aug 13, 2012 at 02:51 PM 0
Share

I'm on 3.5.5f2.

avatar image Jerdak · Aug 13, 2012 at 08:56 PM 0
Share

Well... so your example works just fine for me. Same version of Unity. The only change I made to your code was that I scrapped your library and had Unity rebuild it. Not because I thought it would solve the problem, I just don't trust unknown binaries.

avatar image greay · Aug 14, 2012 at 03:55 AM 0
Share

... what could I possibly be doing wrong? this error doesn't make any sense, but nothing I try will make it go away. I tried deleting the Library and Temp folder and reimporting everything in Unity, then resyncing the $$anonymous$$onoDevelop project, but it still throws the error as soon as I open it up in $$anonymous$$onoDevelop & try to build. I've got the stock $$anonymous$$onoDevelop that comes with Unity (2.8.2). Running OS X (10.8)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Does anyone know how to fix this if statment? 2 Answers

Can't Use MonoDevelop 3 Answers

Can someone help me fix my Javascript for Flickering Light? 6 Answers

I can't open boo or js scripts in Monodevelop with a default install? 3 Answers

How do i say, if ball is -5 and scene is "MainGame1", go to scene GameOver1 ??? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges