diff --git a/lambdas.kl b/lambdas.kl index ef43d8e..aa3e125 100644 --- a/lambdas.kl +++ b/lambdas.kl @@ -11,6 +11,7 @@ pointer_type :: *S64 // null_pointer: pointer_type = null if_stmt :: (cond: S64): type + new_types.basic_type_assignment() CONSTANT :: 10 thing := 10 if i := thing + cond, cond > CONSTANT diff --git a/main.cpp b/main.cpp index c3230bd..8593a54 100644 --- a/main.cpp +++ b/main.cpp @@ -207,10 +207,7 @@ int main(int argument_count, char **arguments){ printf("%s", result.str); result = compile_file("enums.kl"_s); printf("%s", result.str); - result = compile_file("order1.kl"_s); - printf("%s", result.str); - result = compile_file("order2.kl"_s); - printf("%s", result.str); + result = compile_file("new_types.kl"_s); printf("%s", result.str); @@ -222,6 +219,7 @@ int main(int argument_count, char **arguments){ files.add("lambdas.kl"_s); files.add("order1.kl"_s); files.add("order2.kl"_s); + files.add("new_types.kl"_s); String result = compile_files(files); printf("%s", result.str); __debugbreak(); diff --git a/new_types.kl b/new_types.kl index cf78701..15b94c0 100644 --- a/new_types.kl +++ b/new_types.kl @@ -60,8 +60,8 @@ binary_test :: (thing: S32 = 442) basic_type_assignment :: () - custom_data1 := Custom_Data(thing = 23) - custom_data2: Custom_Data + // custom_data1 := Custom_Data(thing = 23) + // custom_data2: Custom_Data some_constant :: true thing: Bool = some_constant float_val :: 325.42 @@ -80,6 +80,7 @@ for_loops :: () for j:=0, j < 10 pass +/* Custom_Data :: struct thing: S32 @@ -108,5 +109,5 @@ array_test :: () len := get_slice_len(thing) with_size: [2]Custom_Data - +*/ // get_slice_len(with_size) \ No newline at end of file diff --git a/typechecking.cpp b/typechecking.cpp index 5595a23..40c3ea3 100644 --- a/typechecking.cpp +++ b/typechecking.cpp @@ -662,7 +662,6 @@ resolve_field_access(Ast_Expr *node, Ast_Scope *context){ if(!new_context){ field_access_scope = context; Operand op = resolve_expr(node, AST_CANT_BE_NULL); - field_access_scope = 0; if(current) current->type = op.type; if(is_pointer(op.type)) op.type = op.type->base; @@ -698,6 +697,7 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags){ scope = field_access_scope; } Ast_Decl *decl = resolve_name(scope, node->pos, node->intern_val, flags); + field_access_scope = 0; // @memes node->resolved_decl = decl; Operand result = operand(decl);