Mono.CSharp.TypeManager.VerifyUnmanaged C# (CSharp) Method

VerifyUnmanaged() public static method

Utility function that can be used to probe whether a type is managed or not.
public static VerifyUnmanaged ( CompilerContext ctx, System.TypeSpec t, Mono.CSharp.Location loc ) : bool
ctx CompilerContext
t System.TypeSpec
loc Mono.CSharp.Location
return bool
	public static bool VerifyUnmanaged (CompilerContext ctx, TypeSpec t, Location loc)
	{
		while (t.IsPointer)
			t = GetElementType (t);

		if (IsUnmanagedType (t))
			return true;

		ctx.Report.SymbolRelatedToPreviousError (t);
		ctx.Report.Error (208, loc,
			"Cannot take the address of, get the size of, or declare a pointer to a managed type `{0}'",
			CSharpName (t));

		return false;	
	}
#region Generics