module

ImplementationChecker

Inherits TypeUnifier

algorithm for deducing trait implementation included by TypeContext

Instance methods

check_method_implemented(method : MethodDef) : Array(Error) | Slice(Type)

for testing purposes this is essentially a copy of #method_implemented?, but returns an array of errors instead of a boolean

Source
each_method(trait : Trait, &)
Source
function_matches_method?(func : FunctionDef, method : Ast::AbstractMethod, errors : Array(String)) : Bool

Check if a given function fulfills the template of the abstract method log errors to the provided array

Source
function_matches_method?(func : FunctionDef, method : Ast::AbstractMethod) : Bool

DEPRECATED see above

Source
instantiate_method(method, type_args : Slice(Type)) : MethodDef
Source
method_implemented?(loc : Location, name : String, signature : Signature) : Bool

Check if a method template is implemented as a function in the current environment

Source
method_implemented?(method : MethodDef) : Bool

Check if a method template is implemented as a function in the current environment

Source
try_method_implementation(method : Ast::AbstractMethod) : Bool

Check if a method is implemented. If not implemented, but has a default body, try to implement it. Return true if method already exists or successfully implemented. Return false and log errors if implementation fails.

Source
type_satisfies_constraints(loc : Location, type : Type, type_param : TypeParameter)

DEPRECATED

Source

Nested types