Add struct access! Uses new translation_unit_generative pass depended on by scope lookups to generate compiler_intrinsics that access members of structs'
This commit is contained in:
@@ -152,7 +152,7 @@ fun adt_lower(name_ast_map: *map<str, pair<*tree<symbol>,*ast_node>>, ast_to_syn
|
||||
backing.cases.for_each(fun(case_stmt: *ast_node) {
|
||||
var option = case_stmt->case_statement.option
|
||||
if (!get_ast_scope(get_ast_type(value)->type_def)->contains_key(str("flag")))
|
||||
error("trying to get flag from struct without it - are you matching on not an adt? - ")
|
||||
error("trying to get flag from struct without it - are you matching on not an adt? - " + get_ast_type(value)->to_string())
|
||||
var flag = get_from_scope(get_ast_type(value)->type_def, "flag")
|
||||
var data = get_from_scope(get_ast_type(value)->type_def, "data")
|
||||
var option_num = -7
|
||||
|
||||
Reference in New Issue
Block a user