INNER CODE UNIT · C#

methodGroups

axmolengine/axmol · tools/bindings-generator/src/BindingGenerator.cs:891

                var methodGroups = current.Methods.GroupBy(x => x.LuaName, StringComparer.Ordinal)
                    .ToDictionary(x => x.Key, x => x.ToArray(), StringComparer.Ordinal);
                var redundant = current.Methods.ToDictionary(
                    method => MethodIdentity(method),
                    method => IsRedundantVirtualOverride(method, current),
                    StringComparer.Ordinal);
                var retained = current.Methods.Where(method =>
                {
                    if (!redundant[MethodIdentity(method)])
                        return true;
                    // A derived Lua overload group may contain a new overload
                    // alongside a C++ override. Keep the whole group in that
                    // case: shadowing the base group would otherwise make the
                    // inherited overload unreachable.
                    return methodGroups[method.LuaName].Any(other =>
                        !string.Equals(MethodIdentity(other), MethodIdentity(method), StringComparison.Ordinal) &&
                        !redundant[MethodIdentity(other)]);
                }).ToArray();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…