private void MethodHidesInheritedNonVirtual(InternalMethod hidingMethod, IMethod hiddenMethod) { Warnings.Add(CompilerWarningFactory.MethodHidesInheritedNonVirtual(hidingMethod.Method, hidingMethod.ToString(), hiddenMethod.ToString())); }
void ResolveMethodOverride(InternalMethod entity) { var baseMethod = FindMethodOverride(entity); if (null == baseMethod) { var suggestion = GetMostSimilarBaseMethodName(entity); if (suggestion == entity.Name) //same name => incompatible signature Error(CompilerErrorFactory.NoMethodToOverride(entity.Method, entity.ToString(), true)); else //suggestion (or null) Error(CompilerErrorFactory.NoMethodToOverride(entity.Method, entity.ToString(), suggestion)); } else ValidateOverride(entity, baseMethod); }
void ResolveMethodOverride(InternalMethod entity) { IMethod baseMethod = FindMethodOverride(entity); if (null == baseMethod) { Error(CompilerErrorFactory.NoMethodToOverride(entity.Method, entity.ToString())); } else { if (!baseMethod.IsVirtual) { CantOverrideNonVirtual(entity.Method, baseMethod); } else { ProcessMethodOverride(entity, baseMethod); } } }