C# Class Boo.Lang.Compiler.TypeSystem.GenericConstructionChecker

Checks a generic construction for several kinds of errors.
Show file Open project: boo/boo-lang Class Usage Examples

Public Methods

Method Description
GenericConstructionChecker ( TypeSystemServices tss, Node constructionNode, IType typeArguments, CompilerErrorCollection errorCollection ) : System
IncorrectGenerity ( IEntity definition ) : bool

Checks if the number of generic parameters on a specified definition does not match the number of supplied type arguments.

NotGenericDefinition ( IEntity entity ) : bool

Checks if a specified entity is not a generic definition.

ViolatesParameterConstraints ( IEntity definition ) : bool

Checks if the given type arguments violate any constraints declared on the type parameters of a specified generic definition.

ViolatesParameterConstraints ( IGenericParameter parameter, IType argument ) : bool

Checks if a specified type argument violates the constraints declared on a specified type paramter.

Private Methods

Method Description
HasDefaultConstructor ( IType argument ) : bool

Checks whether a given type has a default (parameterless) consructor.

Method Details

GenericConstructionChecker() public method

public GenericConstructionChecker ( TypeSystemServices tss, Node constructionNode, IType typeArguments, CompilerErrorCollection errorCollection ) : System
tss TypeSystemServices
constructionNode Node
typeArguments IType
errorCollection CompilerErrorCollection
return System

IncorrectGenerity() public method

Checks if the number of generic parameters on a specified definition does not match the number of supplied type arguments.
public IncorrectGenerity ( IEntity definition ) : bool
definition IEntity
return bool

NotGenericDefinition() public method

Checks if a specified entity is not a generic definition.
public NotGenericDefinition ( IEntity entity ) : bool
entity IEntity
return bool

ViolatesParameterConstraints() public method

Checks if the given type arguments violate any constraints declared on the type parameters of a specified generic definition.
public ViolatesParameterConstraints ( IEntity definition ) : bool
definition IEntity
return bool

ViolatesParameterConstraints() public method

Checks if a specified type argument violates the constraints declared on a specified type paramter.
public ViolatesParameterConstraints ( IGenericParameter parameter, IType argument ) : bool
parameter IGenericParameter
argument IType
return bool