Boo.Lang.Compiler.TypeSystem.GenericConstructionChecker.HasDefaultConstructor C# (CSharp) Method

HasDefaultConstructor() private static method

Checks whether a given type has a default (parameterless) consructor.
private static HasDefaultConstructor ( IType argument ) : bool
argument IType
return bool
        private static bool HasDefaultConstructor(IType argument)
        {
            if (argument.IsValueType)
            {
                return true;
            }

            IConstructor[] constructors = argument.GetConstructors();
            foreach (IConstructor ctor in constructors)
            {
                if (ctor.GetParameters().Length == 0)
                {
                    return true;
                }
            }

            return false;
        }