mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 08:35:39 +00:00
Handle overloads with different element counts
This commit is contained in:
parent
c175a486fc
commit
b652145977
|
@ -304,7 +304,7 @@ namespace Bind.Structures
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var list = Delegates[d.Name];
|
var list = Delegates[d.Name];
|
||||||
var index = list.IndexOf(d);
|
var index = list.FindIndex(w => w.CompareTo(d) == 0);
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
{
|
{
|
||||||
// Function not defined - add it!
|
// Function not defined - add it!
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
@ -244,8 +245,17 @@ namespace Bind.Structures
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Function existing = list[index];
|
Function existing = list[index];
|
||||||
if ((existing.Parameters.HasUnsignedParameters && !unsignedFunctions.IsMatch(existing.Name) && unsignedFunctions.IsMatch(f.Name)) ||
|
bool replace = existing.Parameters.HasUnsignedParameters &&
|
||||||
(!existing.Parameters.HasUnsignedParameters && unsignedFunctions.IsMatch(existing.Name) && !unsignedFunctions.IsMatch(f.Name)))
|
!unsignedFunctions.IsMatch(existing.Name) && unsignedFunctions.IsMatch(f.Name);
|
||||||
|
replace |= !existing.Parameters.HasUnsignedParameters &&
|
||||||
|
unsignedFunctions.IsMatch(existing.Name) && !unsignedFunctions.IsMatch(f.Name);
|
||||||
|
replace |=
|
||||||
|
(from p_old in existing.Parameters
|
||||||
|
join p_new in f.Parameters on p_old.Name equals p_new.Name
|
||||||
|
where p_new.ElementCount == 0 && p_old.ElementCount != 0
|
||||||
|
select true)
|
||||||
|
.Count() != 0;
|
||||||
|
if (replace)
|
||||||
{
|
{
|
||||||
list[index] = f;
|
list[index] = f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue