sammine-lang
Loading...
Searching...
No Matches
BiTypeChecker.h File Reference

Defines the BiTypeCheckerVisitor, consist of the flow for Bi-Directional Type checking, which allows for synthesizing types, validating consistency, and register types. More...

#include "ast/Ast.h"
#include "ast/ASTProperties.h"
#include "ast/AstBase.h"
#include "typecheck/Monomorphizer.h"
#include "typecheck/Types.h"
#include "util/LexicalContext.h"
#include <set>
#include <unordered_map>
Include dependency graph for BiTypeChecker.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sammine_lang::AST::TypingContext
class  sammine_lang::AST::BiTypeCheckerVisitor
struct  sammine_lang::AST::BiTypeCheckerVisitor::TypeClassInfo
struct  sammine_lang::AST::BiTypeCheckerVisitor::TypeClassInstanceInfo

Functions

Type sammine_lang::AST::default_polymorphic_type (const Type &t)
void sammine_lang::AST::resolve_literal_type (ExprAST *expr, const Type &target)

Detailed Description

Defines the BiTypeCheckerVisitor, consist of the flow for Bi-Directional Type checking, which allows for synthesizing types, validating consistency, and register types.

Function Documentation

◆ default_polymorphic_type()

Type sammine_lang::AST::default_polymorphic_type ( const Type & t)
inline

Default a polymorphic numeric type to its concrete default: Integer → I32_t, Flt → F64_t. Non-polymorphic types pass through unchanged.

◆ resolve_literal_type()

void sammine_lang::AST::resolve_literal_type ( ExprAST * expr,
const Type & target )
inline

Recursively resolve polymorphic literal types in an expression tree to a concrete target type. Walks through UnaryNeg, BinaryExpr, IfExpr, and BlockAST to reach all leaf literals.