本文整理汇总了C#中Mono.CSharp.MemberCore.EnableOverloadChecks方法的典型用法代码示例。如果您正苦于以下问题:C# MemberCore.EnableOverloadChecks方法的具体用法?C# MemberCore.EnableOverloadChecks怎么用?C# MemberCore.EnableOverloadChecks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.MemberCore
的用法示例。
在下文中一共展示了MemberCore.EnableOverloadChecks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToContainer
/// <summary>
/// Adds the member to defined_names table. It tests for duplications and enclosing name conflicts
/// </summary>
protected virtual bool AddToContainer (MemberCore symbol, string name)
{
MemberCore mc;
if (!defined_names.TryGetValue (name, out mc)) {
defined_names.Add (name, symbol);
return true;
}
if (((mc.ModFlags | symbol.ModFlags) & Modifiers.COMPILER_GENERATED) != 0)
return true;
if (symbol.EnableOverloadChecks (mc))
return true;
InterfaceMemberBase im = mc as InterfaceMemberBase;
if (im != null && im.IsExplicitImpl)
return true;
Report.SymbolRelatedToPreviousError (mc);
if ((mc.ModFlags & Modifiers.PARTIAL) != 0 && (symbol is ClassOrStruct || symbol is Interface)) {
Error_MissingPartialModifier (symbol);
return false;
}
if (this is ModuleContainer) {
Report.Error (101, symbol.Location,
"The namespace `{0}' already contains a definition for `{1}'",
((DeclSpace)symbol).NamespaceEntry.GetSignatureForError (), symbol.MemberName.Name);
} else if (symbol is TypeParameter) {
Report.Error (692, symbol.Location,
"Duplicate type parameter `{0}'", symbol.GetSignatureForError ());
} else {
Report.Error (102, symbol.Location,
"The type `{0}' already contains a definition for `{1}'",
GetSignatureForError (), symbol.MemberName.Name);
}
return false;
}
示例2: AddNameToContainer
//
// Adds the member to defined_names table. It tests for duplications and enclosing name conflicts
//
public virtual void AddNameToContainer (MemberCore symbol, string name)
{
if (((ModFlags | symbol.ModFlags) & Modifiers.COMPILER_GENERATED) != 0)
return;
MemberCore mc;
if (!PartialContainer.defined_names.TryGetValue (name, out mc)) {
PartialContainer.defined_names.Add (name, symbol);
return;
}
if (symbol.EnableOverloadChecks (mc))
return;
InterfaceMemberBase im = mc as InterfaceMemberBase;
if (im != null && im.IsExplicitImpl)
return;
Report.SymbolRelatedToPreviousError (mc);
if ((mc.ModFlags & Modifiers.PARTIAL) != 0 && (symbol is ClassOrStruct || symbol is Interface)) {
Error_MissingPartialModifier (symbol);
return;
}
if (symbol is TypeParameter) {
Report.Error (692, symbol.Location,
"Duplicate type parameter `{0}'", symbol.GetSignatureForError ());
} else {
Report.Error (102, symbol.Location,
"The type `{0}' already contains a definition for `{1}'",
GetSignatureForError (), name);
}
return;
}
示例3: EnableOverloadChecks
public override bool EnableOverloadChecks (MemberCore overload)
{
// TODO: It can be deleted when members will be defined in correct order
if (overload is Operator)
return overload.EnableOverloadChecks (this);
if (overload is Indexer)
return false;
return base.EnableOverloadChecks (overload);
}