diff --git a/build.bat b/build.bat index 8e18089..7d8ea68 100644 --- a/build.bat +++ b/build.bat @@ -3,7 +3,7 @@ call "..\misc\compile_setup.bat" bld --dont_compile_core cd build -core_main.exe rtsgame/main.core +rem core_main.exe rtsgame/main.core bld --dont_compile_core --link=vendor/raylib/windows/raylibdll.lib rem build\generated_main.exe cd .. diff --git a/build/rtsgame/main.core b/build/rtsgame/main.core index b400c28..80f8282 100644 --- a/build/rtsgame/main.core +++ b/build/rtsgame/main.core @@ -47,7 +47,7 @@ Add(&guys, {100, 100}) // @reproduction -// MAP: [16*16]int = {0, 1} +// // // This generates: int MAP[256] = (int [256]){[0] = 0, [0] = 1}; it doesn't work because of the (int[256]) is this MSVC being retarded here? not supporting C properly? // Also this ^ ^ @@ -87,6 +87,7 @@ MouseSelectedActors: Array(*MAP.Actor) // @todo: ids main :: (): int MAP.Init() + // HERE_IT_IS: [16*16]int = {0, 1} // InitAudioDevice() // sound := LoadSound("catune - Pass the town, and to the C.mp3") diff --git a/core_typechecking.cpp b/core_typechecking.cpp index 371bf2d..4fa3214 100644 --- a/core_typechecking.cpp +++ b/core_typechecking.cpp @@ -1040,7 +1040,7 @@ resolve_compound_array(Ast_Call *node, Ast_Type *type) { if (is_array(type) && node->exprs.len > size) compiler_error(node->pos, "Too many items in compound expression, expected: %lld got: %lld", size, node->exprs.len); - S64 default_counter = 0; + int default_counter = 0; For(node->exprs) { if (is_flag_set(it->call_flags, CALL_NAME)) compiler_error(it->pos, "Arrays can't have named compound expression arguments"); @@ -1064,6 +1064,7 @@ resolve_compound_array(Ast_Call *node, Ast_Type *type) { make_sure_value_is_compatible_with_type(it->pos, &item, item_type, TYPE_AND_EXPR_REQUIRED); it->resolved_type = item_type; try_propagating_resolved_type_to_untyped_literals(it->item, it->resolved_type); + default_counter += 1; } }