diff --git a/core_typechecking.cpp b/core_typechecking.cpp index 2a801db..86412c1 100644 --- a/core_typechecking.cpp +++ b/core_typechecking.cpp @@ -971,14 +971,13 @@ try_propagating_resolved_type_to_untyped_literals(Ast *ast, Ast_Type *type, Ast_ } } -// @todo: Remove compound context function Ast_Type * -resolve_typespec(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_context = 0){ +resolve_typespec(Ast_Expr *ast, Resolve_Flag flags){ if(!ast && is_flag_set(flags, AST_CAN_BE_NULL)) return 0; Scratch scratch; - Operand resolved = resolve_expr(ast, flags | RESOLVE_TYPESPEC, compound_context, 0); + Operand resolved = resolve_expr(ast, flags | RESOLVE_TYPESPEC, 0, 0); if(is_flag_set(flags, RESOLVE_TYPESPEC_COMPLETE)) type_complete(resolved.type_val); if(resolved.type != type_type) @@ -986,9 +985,8 @@ resolve_typespec(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_context = return resolved.type_val; } -// @todo: Remove compound context function Operand -resolve_and_require_bool(const char *error, Ast_Expr *expr, Resolve_Flag flags, Ast_Type *compound_context = 0){ +resolve_and_require_bool(const char *error, Ast_Expr *expr, Resolve_Flag flags){ if(!expr){ if(flags == AST_CAN_BE_NULL) return {}; @@ -996,7 +994,7 @@ resolve_and_require_bool(const char *error, Ast_Expr *expr, Resolve_Flag flags, } Scratch scratch; - Operand op = resolve_expr(expr, flags, compound_context, 0); + Operand op = resolve_expr(expr, flags, 0, 0); if(!is_bool(op.type)){ compiler_error(expr->pos, "Expected type [Bool] got instead type %Q :: %s", typestring(op.type), error); } @@ -1004,10 +1002,9 @@ resolve_and_require_bool(const char *error, Ast_Expr *expr, Resolve_Flag flags, return op; } -// @todo: Remove compound context function Operand -require_const_int(Ast_Expr *expr, Resolve_Flag flags, Ast_Type *compound_context = 0){ - Operand op = resolve_expr(expr, flags, compound_context, 0); +require_const_int(Ast_Expr *expr, Resolve_Flag flags){ + Operand op = resolve_expr(expr, flags, 0, 0); if(expr == 0 && flags) return op; diff --git a/examples/any_and_variadic_args.core b/examples/any_and_variadic_args.core index a8d3e03..64eff74 100644 --- a/examples/any_and_variadic_args.core +++ b/examples/any_and_variadic_args.core @@ -4,6 +4,13 @@ main :: (): int b := 20 values := []Any{a, b} - c := values[0].data - + for values + Assert(it.type == S64) + + Assert(*(values[0].data->*S64) == 10) + Assert(*(values[1].data->*S64) == 20) + + // @todo: maybe this is better? Assert(*cast(*S64)values[0].data == 10) + + return 0 \ No newline at end of file