Goose  Artifact [386be1eb49]

Artifact 386be1eb4945f7b70c357e729a7b03c55aebfcc216490856d4febe717e03bd45:

  • File bs/sema/typecheck.h — part of check-in [0db147f117] at 2024-09-15 20:24:31 on branch cir-ssa-refactor — Add clang format settings, reformat everything (user: achavasse size: 767)

#ifndef GOOSE_SEMA_TYPECHECK_H
#define GOOSE_SEMA_TYPECHECK_H

namespace goose::sema
{
    struct NoUnification
    {
    };

    struct AmbiguousTypeCheck
    {
    };

    using TCSol = pair< Term, TypeCheckingContext >;

    using TypeCheckingSolution = variant< NoUnification, AmbiguousTypeCheck, TCSol >;

    TypeCheckingSolution FindBestTyping( const Term& lhs, const Term& rhs, const Context& context );

    using TCGen = Generator< pair< Term, TypeCheckingContext > >;

    TCGen TypeCheck( const Term& lhs, const Term& rhs, const TypeCheckingContext& tcc );

    TCGen Unify( const Term& lhs, const Term& rhs, const TypeCheckingContext& tcc );
    optional< Term > HalfUnify( const Term& lhs, TypeCheckingContext& tcc );
} // namespace goose::sema

#endif