Skip to content

Commit

Permalink
Fix overload scoring code
Browse files Browse the repository at this point in the history
- This was preventing the most correct method from being chosen for a combination of arguments in some cases. The scoring wasn't happening at all, and it just happened to work in many cases on the basis of the order of the methods being correct in most cases. The specific issue that highlighted this problem was that bit shifts on a byte variable as the lhs and an inte variable on the rhs was choosing the incorrect method.
  • Loading branch information
MerlinVR committed Apr 19, 2020
1 parent 94f648f commit a679eed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Assets/UdonSharp/Editor/UdonSharpResolverContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,9 @@ public MethodBase FindBestOverloadFunction(MethodBase[] methods, List<System.Typ
scoredMethods.Add(new System.Tuple<MethodBase, float>(methodInfo, finalScore));
}

scoredMethods.OrderBy(e => e.Item1);
scoredMethods = scoredMethods.OrderBy(e => e.Item2).ToList();

//Debug.Log("Scoring");
//foreach (var scoredMethod in scoredMethods)
// Debug.Log($"Score: {scoredMethod.Item2},{scoredMethod.Item1}");

Expand Down

0 comments on commit a679eed

Please sign in to comment.