Created
January 16, 2016 14:53
-
-
Save gjroelofs/626a67f22a6956e361c9 to your computer and use it in GitHub Desktop.
Internal Compiler Errors in Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ExtensionTests { | |
public static void Test(this object target, float a, float b = 1, float c = 2, float d = 3) { } | |
} | |
object target = null; | |
// Compiles | |
target.Test(0); | |
target.Test(0, b: 2); | |
target.Test(0, d:2 , c: 2); | |
target.Test(b:2, a:0); | |
target.Test(b: 2, a: 3, d: 2); | |
// Does not compile | |
/* | |
target.Test(c: 2, a: 0); | |
target.Test(d: 2, a: 0); | |
target.Test(d:2, b:2, a:3); | |
target.Test(b: 2, d: 2, a: 3); | |
*/ | |
// The error message: | |
/* | |
Unhandled Exception: Mono.CSharp.InternalErrorException: Internal error | |
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.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.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in <filename unknown>:0 | |
Internal compiler | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment