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 /
This question was closed Dec 18, 2011 at 10:11 AM by gregzo for the following reason:

Problem is not reproducible or outdated

avatar image
2
Question by gregzo · Dec 14, 2011 at 11:39 AM · dictionarygeneric

JS: Dictionary is not a generic definition error...

Hi to all!

Ive just started using generics, lists work fine, dictionaries give me this error code. Help would be great!

  var myDic : Dictionary.<String,int> = new Dictionary.<String,int>();`
Comment
Add comment · Show 5
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 gregzo · Dec 14, 2011 at 09:09 PM 0
Share

No one? Nobody? Eric5h5, Statement, Bunny, by the powers of the newbie, I invoke thee!

avatar image Lo0NuhtiK · Dec 14, 2011 at 09:50 PM 2
Share

Nice variable name lol

avatar image gregzo · Dec 14, 2011 at 10:07 PM 0
Share

But does it deserve an up vote? Lol...Still stuck with this.

avatar image Lo0NuhtiK · Dec 14, 2011 at 10:11 PM 0
Share

Idk, I can't vote on anything cuz I'm still a level 1 forum character.

avatar image jahroy · Dec 14, 2011 at 10:33 PM 0
Share

I think you should post a few more lines of code from above and below the line you've listed.

Including the full message from the compiler might help, too.

3 Replies

  • Sort: 
avatar image
0
Best Answer

Answer by jahroy · Dec 14, 2011 at 09:45 PM

If I paste your code into my project it works fine.

Do you have a syntax error (like a forgotten semi-colon) on the line above or something?

Comment
Add comment · Show 4 · 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 gregzo · Dec 14, 2011 at 10:06 PM 0
Share

Typo, not easy to type code with an iPad on this forum...

avatar image jahroy · Dec 14, 2011 at 10:16 PM 0
Share

Agreed.

Still, it works for me.

I assume you're including System.Collections.Generic....

avatar image gregzo · Dec 14, 2011 at 10:48 PM 0
Share

Reboot did the trick, argh!

avatar image jahroy · Dec 14, 2011 at 11:06 PM 0
Share

Glad I could help ;)

avatar image
1

Answer by Eric5h5 · Dec 14, 2011 at 10:18 PM

 import System.Collections.Generic;
 
 ...
 
 var myDic = new Dictionary.<String,int>();

You should import the System.Collections.Generic namespace when using List too, since not everything is available without it.

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 gregzo · Dec 14, 2011 at 10:29 PM 0
Share

I am importing... and I still can't declare myDic without pissing off the compiler.

avatar image jahroy · Dec 14, 2011 at 10:31 PM 0
Share

@gregzo - your code works for me if I paste it into my project exactly as you list it.

avatar image
0

Answer by gregzo · Dec 14, 2011 at 10:46 PM

After a full reboot, the error doesn't show up anymore. Same code... Had tried restarting unity, hadn't worked. Thanks for the support! Does this kind of quirk happen often?

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 Eric5h5 · Dec 14, 2011 at 10:59 PM 0
Share

I've never seen that happen; maybe it was an old error that you hadn't cleared.

avatar image gregzo · Dec 14, 2011 at 11:00 PM 0
Share

I rebooted unity...

avatar image jahroy · Dec 14, 2011 at 11:08 PM 0
Share

I think Eric is saying you may have just been seeing a runtime error that was left in the console.

Some errors disappear when you fix them. Others stay there until you clear the console... Or maybe reboot your computer.

There are also times when little green elves sneak into the room and change the way the compiler works.

avatar image Eric5h5 · Dec 14, 2011 at 11:17 PM 0
Share

Freakin' elves....

avatar image gregzo · Dec 15, 2011 at 03:22 PM 0
Share

Even if compiler elves don't exist, I think I've proven they don't appreciate my var na$$anonymous$$g humour... Still lost a full friggin hour on that silly error! Grrr...

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Accessing float from dictionary 2 Answers

Help understanding this generic list in JS. 1 Answer

Storing XML node and accessing from a dictionary 0 Answers

Need help converting js to C# -- yield return WaitForSeconds 3 Answers

Converting JS to C# 3 Answers


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