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
6
Question by DESTRUKTORR · Aug 14, 2012 at 01:27 PM · errordebugcompilerwarninginternal

Warning messages are turning into Internal Compiler Errors...?

As the title states, warning messages are turning into internal compiler errors. These all used to just be warnings (the little yellow "yield sign" looking thing, that doesn't actually prevent running of the game), but are now (one by one) turning into internal compiler errors.

Here's an example:

 Internal compiler error. See the console log for more information. 
 
 output was:Assets/MyStuff/myScripts/System Scripts/SaveManager.cs(444,40): warning CS0219: The variable `s' is assigned but its value is never used
 
 Assets/MyStuff/myScripts/System Scripts/SaveManager.cs(456,32): warning CS0219: The variable `s1' is assigned but its value is never used
 
 Assets/MyStuff/myScripts/System Scripts/SaveManager.cs(488,38): warning CS0219: The variable `encoding' is assigned but its value is never used

I understand what the issue is, but it shouldn't be causing an error, and preventing me from testing the game. The biggest problem is that there's dozens of these things, and I get the feeling that the fact that they're all of a sudden deciding to be worthy of stopping the testing process, that there might be a bigger issue, here.

If you couldn't tell by the errors, here, I'm using almost exclusively c#, so it's not just that I've used #pragma strict, or something. Frankly, I don't have the foggiest idea what's going on, so any insight into how I could stop this would be vastly appreciated. Thank you!

[Edit], Also, if you want more of the error log, I can post it in a comment, I just don't have the time to sift through it and take out any information that might reveal anything sensetive about the game, and I don't want to discourage people.

Comment
Add comment · Show 8
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 Kryptos · Aug 14, 2012 at 02:07 PM 0
Share

Only warnings? $$anonymous$$aybe there is a real error among them.

Anyway, try to fix all warnings (looking at the one you posted, this should be fixed by commenting the corresponding lines).

avatar image by0log1c · Aug 14, 2012 at 02:21 PM 0
Share

I've had similar issues with unused exception variable within try/catch statement causing these internal compiler error. They're easy to fix but I can't figure why they occur in the first place. As far as I remember, I wasn't doing anything fancy - it just decided not using my variable was a terrible error. I'd like to hear about the actual cause, too.

avatar image DESTRUKTORR · Aug 14, 2012 at 02:39 PM 0
Share

The strangest part was that many of these warnings had been around for weeks... $$anonymous$$any of which were in files I haven't opened or edited, or edited files that they were dependent on... I even tried re-downloading and re-installing Unity... so whatever it is, it's in the project folder. When I get home, today, I'll try going into another scene, to see if there's just some sort of corruption, there.

avatar image DESTRUKTORR · Aug 14, 2012 at 07:39 PM 0
Share

Never$$anonymous$$d... false alarm ): tried reimporting all assets, and it looked like it worked, but... alas, it did not... sigh

avatar image SARWAN · Apr 01, 2013 at 04:48 AM 0
Share

Now i too got the same error. Reimporting all the assets will solves this issue?

Internal compiler error. See the console log for more information. output was

Show more comments

6 Replies

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

Answer by DESTRUKTORR · Aug 14, 2012 at 09:31 PM

Ok, NOW I figured out what it was... Apparently it was listing all the warnings in the same message as the actual error, which was aaaall the way at the bottom of that window (there's the debug window, with a list of errors/warnings, then there's the window with the currently selected error/warning... that's the one that had all the warnings listed there).

Additionally, all the previous warnings were listed as warnings, above... Apparently, though, something happened that made Unity not like that I used base.Update(); and base.Start();, to inherit from the previous start/update methods, without overriding them... Oddly enough, those had been there for quite a while, so I'm not sure what happened, but it's fixed now.

Comment
Add comment · Show 3 · 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 Kryptos · Aug 16, 2012 at 08:43 AM 0
Share

Start() and Update() are called by the engine using reflection. Even if you want to call the base method, you have to make them virtual and protected at least (or public if you want) and to explicitly override them.

 // base class
 protected virtual void Start() { }

 // derived class
 protected override void Start() { base.Start(); }

Actually, this should be the same with all event-based methods of $$anonymous$$onoBehaviour.

avatar image DESTRUKTORR · Aug 17, 2012 at 02:29 AM 0
Share

Yeah, I'd read up on that. The issue I was running into didn't directly pertain to that, though, as much as the fact that it wouldn't direct me to the actual problem area in the script, from the debugger, and it was mashing all the warning messages in with the error, so it was almost impossible to tell what was actually going wrong :P

avatar image YJack · Oct 08, 2013 at 08:03 PM 0
Share

Same issue here. Warnings just become Errors when I used base.Start(), base.Update()... Funny.

avatar image
-1

Answer by gekidoslair · Aug 31, 2015 at 10:18 PM

Ran into the same issue calling a base function from within one of Unity's monobehaviour functions.

I had something like this in the child class

void OnDisable() { base.MyFunction(); }

which completely broke the Unity compiler it seems.

Simply making the base function protected instead of private fixed the issue (don't need the base. prefix optionally as well).

Still lost 1/2 hour trying to figure out why Unity was borked. Must have blown up the Mono compiler in a wierd way.

Comment
Add comment · Show 1 · 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 Kryptos · Sep 01, 2015 at 07:54 AM 0
Share

No that's just you not learning the program$$anonymous$$g language you are using.

$$anonymous$$ethods from base class can only be called in child class is they are at least protected. Private method/property/field are sealed in their own compiled unit (here a class) and cannot be called outisde their definition scope (unless using reflection but taht is another matter).

avatar image
0

Answer by whydoidoit · Feb 28, 2013 at 11:40 AM

I'm getting this problem and the compiler is crashing with this error:

 Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
   at Mono.CSharp.TypeInference.DoSecondPhase (Mono.CSharp.ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, System.Type[] methodParameters, Boolean fixDependent) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.TypeInference.InferInPhases (Mono.CSharp.ResolveContext ec, Mono.CSharp.TypeInferenceContext tic, Mono.CSharp.AParametersCollection methodParameters) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.TypeInference.InferMethodArguments (Mono.CSharp.ResolveContext ec, System.Reflection.MethodBase method) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.TypeManager.InferTypeArguments (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments arguments, System.Reflection.MethodBase& method) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Int32 arg_count, System.Reflection.MethodBase& method, System.Boolean& params_expanded_form) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.ExtensionMethodGroupExpr.ResolveOverloadExtensions (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Mono.CSharp.NamespaceEntry ns, Location loc) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.ExtensionMethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Arguments& arguments, Boolean may_fail, Location loc) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.ResolveContext ec, Mono.CSharp.Expression right_side) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Assign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.SimpleAssign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.If.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.TryCatch.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0 
  
 (Filename:  Line: 0)


The error in the Unity log is just the same old - warning compressed into a compiler internal error

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 whydoidoit · Feb 28, 2013 at 11:40 AM 0
Share

Added as an answer as the stack trace is too long for a comment.

avatar image 1337GameDev · Mar 11, 2013 at 02:13 AM 0
Share

If you look, there is a null pointer reference. Just click the error (or double click) and it should take you back to the line. If it's your script, make sure variables are loaded, or check for null before using.

If its not your script (and belongs to some other package you downloaded or copied) you should look over the documentation for the package and such. You may also need to update the plugin / package.

avatar image 1337GameDev · Apr 01, 2013 at 02:21 PM 0
Share

Handle null references first. Handle errors from top to bottom of list. Errors can cause other errors to appear, and null references cause weird, almost unpredictable things, to occur.

avatar image Komak57 · Sep 01, 2015 at 07:33 PM 0
Share

Null Reference with a long stack usually implies a deeply embedded system of calls eventually tried to call on a variable/object that had been destroyed while it was finishing an operation. This can happen if you call a method inside a catch {} that leads to calling the same method it's found in (infinite loop) until you run out of ram for loading an object before you reach a stack trace limit.

avatar image
0

Answer by Komak57 · Apr 03, 2014 at 02:07 AM

For those of you who didn't find a resolution for this, note that

 try {
     if (true)
         throw System.NullReferenceException;
 } catch {}

will also cause this problem.

Comment
Add comment · 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
0

Answer by Archie888 · Aug 30, 2015 at 04:14 PM

I had an issue like this, with threaded stuff, tasks involved etc, using Parse with unity. In my case, I had one error line, in which it seemed that warning messages were written on. If you have a scenario like mine, scroll down the whole message, and you will see that this is not only about warnings turning into errors, but there is an actual error message there in the end, with a long stack trace.

My specific error message was: "Unhandled Exception: System.ArgumentException: Trying to emit a local from a different ILGenerator."

I had a try-catch block in the specific code that was causing issues. Removing that try-catch block removed my specific issue.

Very weird. I'll repeat this post in all threads on the issue I can find, perhaps it can help someone.

Comment
Add comment · 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
  • 1
  • 2
  • ›

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

19 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

Related Questions

Internal Compiler Error again 1 Answer

error CS0016 - Access to the path is denied 1 Answer

Internal Compiler Error 6 Answers

Internal Compiler Error 1 Answer

Internal Compiler Error 0 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