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
0
Question by Nezabyte · Oct 06, 2013 at 06:13 PM · c#errorparameters

Are named parameters supported?

Are named parameters supported? When I tried to use them in my code, I got a vague "internal compiler error" in the Unity console log.

Comment
Add comment · Show 4
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 tw1st3d · Oct 06, 2013 at 06:13 PM 1
Share

Post your error.

avatar image Nezabyte · Oct 06, 2013 at 06:16 PM 0
Share
 Unhandled Exception: $$anonymous$$ono.CSharp.InternalErrorException: Internal error
 
   at $$anonymous$$ono.CSharp.$$anonymous$$ethodGroupExpr.IsApplicable ($$anonymous$$ono.CSharp.ResolveContext ec, $$anonymous$$ono.CSharp.Arguments& arguments, Int32 arg_count, System.Reflection.$$anonymous$$ethodBase& method, System.Boolean& params_expanded_form) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.$$anonymous$$ethodGroupExpr.OverloadResolve ($$anonymous$$ono.CSharp.ResolveContext ec, $$anonymous$$ono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.New.DoResolve ($$anonymous$$ono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Expression.Resolve ($$anonymous$$ono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Expression.Resolve ($$anonymous$$ono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Argument.Resolve ($$anonymous$$ono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Arguments.Resolve ($$anonymous$$ono.CSharp.ResolveContext ec, System.Boolean& dynamic) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Invocation.DoResolve ($$anonymous$$ono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Expression.Resolve ($$anonymous$$ono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Expression.Resolve ($$anonymous$$ono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.ExpressionStatement.ResolveStatement ($$anonymous$$ono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.StatementExpression.Resolve ($$anonymous$$ono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Block.Resolve ($$anonymous$$ono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.ToplevelBlock.Resolve ($$anonymous$$ono.CSharp.FlowBranching parent, $$anonymous$$ono.CSharp.BlockContext rc, $$anonymous$$ono.CSharp.ParametersCompiled ip, I$$anonymous$$ethodData md) [0x00000] in <filename unknown>:0 
 
avatar image Jamora · Oct 06, 2013 at 06:19 PM 0
Share

A piece of code to replicate the error would be great too.

avatar image Nezabyte · Oct 06, 2013 at 06:22 PM 0
Share

Well mainly I wanted to know if they're supported or not in Unity 3D/$$anonymous$$onoDevelop. If they aren't, I just won't use them. If they are, then I know I'm doing something wrong on my end.

1 Reply

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

Answer by tw1st3d · Oct 06, 2013 at 06:26 PM

After a little bit of research, it's looking like Unity does support named parameters. However, I may be incorrect, so you should do more research yourself.

Source

Comment
Add comment · Show 6 · 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 Nezabyte · Oct 06, 2013 at 06:27 PM 1
Share

I'm doing some more testing on my end. It might be because I'm using default parameters as well, but with the named parameters, I had coincidentally set them in a different order from the parameter list

avatar image Jamora · Oct 06, 2013 at 06:31 PM 0
Share

The example in Named Arguments works for me, but maybe it's a different thing... You should post your code so we know what we're talking about here.

With named arguments it shouldn't matter what order you give them in, as long as no unnamed arguments follow.

avatar image tw1st3d · Oct 06, 2013 at 06:32 PM 0
Share

@Nezabyte If this is this answer is correct, would you $$anonymous$$d ticking it? :)

avatar image Jamora · Oct 06, 2013 at 06:41 PM 2
Share

Its fine if you solved it, don't worry about the code. You haven't however ticked this answer because it's not green. To mark this answer as correct, click the currently gray checkmark below the thumbs.

avatar image Hoeloe · Oct 06, 2013 at 07:27 PM 0
Share

I'd be quite interested to see the code, actually, to see what was wrong. I know that named and optional parameters both require being placed at the end of the argument tuple (so that there are no unnamed parameters after a named one, and no obligatory arguments after an optional one), but other than that I'm not sure what would be causing the error. Unless of course the error was caused by that setup, in which case it's fine.

Show more comments

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

20 People are following this question.

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

Related Questions

Distribute terrain in zones 3 Answers

Multiple Cars not working 1 Answer

Disabling A Script on a GameObject From a Different Script 2 Answers

Sync with visual studio 2010 error 1 Answer

Error: error CS0029: Cannot implicitly convert type `UnityEngine.GameObject[]' to `UnityEngine.GameObject 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