public bool isUnsafe()
{
// Pointer types are the only unsafe types.
// Note that generics may not be instantiated with pointer types
return (this != null && (IsPointerType() || (IsArrayType() && AsArrayType().GetElementType().isUnsafe())));
}
public bool isPredefType(PredefinedType pt)
public void checkUnsafe(CType type, ErrorCode errCode, ErrArg pArg) { Debug.Assert((errCode != ErrorCode.ERR_SizeofUnsafe) || pArg != null); if (type == null || type.isUnsafe()) { if (!isUnsafeContext() && ReportUnsafeErrors()) { if (pArg != null) ErrorContext.Error(errCode, pArg); else ErrorContext.Error(errCode); } RecordUnsafeUsage(); } }