本文整理汇总了C#中TypeSpec.GetSignatureForError方法的典型用法代码示例。如果您正苦于以下问题:C# TypeSpec.GetSignatureForError方法的具体用法?C# TypeSpec.GetSignatureForError怎么用?C# TypeSpec.GetSignatureForError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeSpec
的用法示例。
在下文中一共展示了TypeSpec.GetSignatureForError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Error_ValueCannotBeConverted
public override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec t, bool expl)
{
if (t.IsGenericParameter) {
ec.Report.Error(403, loc,
"Cannot convert null to the type parameter `{0}' because it could be a value " +
"type. Consider using `default ({0})' instead", t.Name);
return;
}
if (TypeSpec.IsValueType (t)) {
ec.Report.Error(37, loc, "Cannot convert null to `{0}' because it is a value type",
t.GetSignatureForError ());
return;
}
base.Error_ValueCannotBeConverted (ec, t, expl);
}
示例2: Error_InvalidConstantType
public static void Error_InvalidConstantType (TypeSpec t, Location loc, Report Report)
{
if (t.IsGenericParameter) {
Report.Error (1959, loc,
"Type parameter `{0}' cannot be declared const", t.GetSignatureForError ());
} else {
Report.Error (283, loc,
"The type `{0}' cannot be declared const", t.GetSignatureForError ());
}
}