Struct Typecase

Inheritance Relationships

Base Type

Struct Documentation

struct Typecase : public AST::ASTNode

Public Functions

Typecase(ASTNode *expr, std::vector<TypeAlternative *> *alts)
~Typecase()
void print_original_src(unsigned int indent_depth)
bool perform_type_inference(TypeCheck::Settings &settings, Quack::Class *parent_type)

Implements type inference for a single note in the AST.

Return
True if type inference was successful.
Parameters
  • st: Symbol table for the method
  • return_type: Return type from the block
  • parent_type: Type of the parent node. If parent node has no type, then BASE_CLASS.

bool check_initialize_before_use(InitializedList &inits, InitializedList *all_inits, bool is_method)
bool contains_return_all_paths()

Typecase always returns false since no guarantee all objects are not guaranteed to match a statement.

Return
Always false

std::string generate_code(CodeGen::Settings &settings, unsigned indent_lvl, bool is_lhs) const