Esempio n. 1
0
        private static void BuildExplicitImplementation(AbcInstance instance, AbcMethod abcMethod,
                                                        IMethod ifaceMethod, AbcMethod ifaceAbcMethod)
        {
            instance.DefineMethod(
                Sig.@from(ifaceAbcMethod),
                code =>
            {
                code.LoadThis();
                code.LoadArguments(ifaceMethod);
                code.Call(abcMethod);
                if (ifaceAbcMethod.IsVoid)
                {
                    code.ReturnVoid();
                }
                else
                {
                    code.ReturnValue();
                }
            },
                m =>
            {
                var isOverride =
                    instance.BaseInstances()
                    .FirstOrDefault(x => x.Traits.Contains(ifaceAbcMethod.TraitName, ifaceAbcMethod.Trait.Kind)) != null;

                m.Trait.IsOverride = isOverride;

                OverrideExplicitImplsInSubclasses(instance, ifaceAbcMethod);
            });
        }