Boo.Lang.Compiler.Steps.ProcessMethodBodies.AssertCanCreateInstance C# (CSharp) Метод

AssertCanCreateInstance() приватный Метод

private AssertCanCreateInstance ( Node sourceNode, IType type ) : bool
sourceNode Node
type IType
Результат bool
        bool AssertCanCreateInstance(Node sourceNode, IType type)
        {
            if (type.IsInterface)
            {
                Error(CompilerErrorFactory.CantCreateInstanceOfInterface(sourceNode, type));
                return false;
            }
            if (type.IsEnum)
            {
                Error(CompilerErrorFactory.CantCreateInstanceOfEnum(sourceNode, type));
                return false;
            }

            if (type.IsAbstract)
            {
                Error(CompilerErrorFactory.CantCreateInstanceOfAbstractType(sourceNode, type));
                return false;
            }

            if (!(type is GenericConstructedType)
                && ((type.GenericInfo != null && type.GenericInfo.GenericParameters.Length > 0)
                    || (type.ConstructedInfo != null && !type.ConstructedInfo.FullyConstructed)))
            {
                Error(CompilerErrorFactory.GenericTypesMustBeConstructedToBeInstantiated(sourceNode));
                return false;
            }
            return true;
        }
ProcessMethodBodies