コード例 #1
0
 private bool HasDuplicates(Definitions.Implementation.Class cls, Definitions.Implementation.Method mth, string nativeName,
                            Func <Definitions.Implementation.Class, ISet <Definitions.Implementation.Method> > getMethods)
 {
     while (cls != null)
     {
         foreach (var m in getMethods(cls))
         {
             if (m.Selector != mth.Selector)
             {
                 string native = m.Annotations.GetFirst("ist.runtime.native-name");
                 if (native == nativeName)
                 {
                     if (this.NumberOfParameters(m.Selector) == this.NumberOfParameters(mth.Selector))
                     {
                         return(true);
                     }
                 }
             }
         }
         cls = cls.Parent.Classes.FirstOrDefault(c => c.Name == cls.SuperclassName);
     }
     return(false);
 }
コード例 #2
0
 private bool HasDuplicateClassNativeName(Definitions.Implementation.Class cls, Definitions.Implementation.Method mth, string nativeName)
 {
     if (this.HasDuplicates(cls, mth, nativeName, c => c.ClassMethods))
     {
         return(true);
     }
     return(this.HasDuplicateInstanceNativeName(mth.Parent.Parent.Classes.FirstOrDefault(c => c.Name == "Class"), mth, nativeName));
 }
コード例 #3
0
 private bool HasDuplicateInstanceNativeName(Definitions.Implementation.Class cls, Definitions.Implementation.Method mth, string nativeName)
 {
     return(this.HasDuplicates(cls, mth, nativeName, c => c.InstanceMethods));
 }