Fix type incomplete of argument in away procedure that has a pointer to
that that is never used outside of procedure definition. We emit void.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,6 +10,7 @@
|
|||||||
*.lib
|
*.lib
|
||||||
*.o
|
*.o
|
||||||
*.10x
|
*.10x
|
||||||
|
*.obj
|
||||||
|
|
||||||
*.sublime-*
|
*.sublime-*
|
||||||
tests/
|
tests/
|
||||||
|
|||||||
@@ -80,7 +80,12 @@ get_ctype_name_for_type(Ast_Type *type){
|
|||||||
case TYPE_TUPLE: return "Tuple";
|
case TYPE_TUPLE: return "Tuple";
|
||||||
case TYPE_TYPE: return "int64_t";
|
case TYPE_TYPE: return "int64_t";
|
||||||
|
|
||||||
case TYPE_INCOMPLETE: return "(Internal compiler error: [Type_Incomplete])";
|
case TYPE_INCOMPLETE: {
|
||||||
|
// This happens in case where we have a procedure in an away module.
|
||||||
|
// And that procedure takes a pointer from a struct that is never
|
||||||
|
// use elsewhere. In that case this seems fine.
|
||||||
|
return "void";
|
||||||
|
}
|
||||||
invalid_default_case;
|
invalid_default_case;
|
||||||
}
|
}
|
||||||
return "<unknown_type>";
|
return "<unknown_type>";
|
||||||
|
|||||||
@@ -273,6 +273,9 @@ resolve_everything_in_module(Ast_Module *module) {
|
|||||||
resolve_name(file, decl->pos, decl->name);
|
resolve_name(file, decl->pos, decl->name);
|
||||||
|
|
||||||
if (decl->kind == AST_STRUCT) {
|
if (decl->kind == AST_STRUCT) {
|
||||||
|
// if (decl->name == pctx->intern("CreateFileW"_s)) {
|
||||||
|
// __debugbreak();
|
||||||
|
// }
|
||||||
type_complete(decl->type_val);
|
type_complete(decl->type_val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1512,6 +1512,9 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_and_const_str
|
|||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
// if (node->name->pos->string == "CreateFileW"_s) {
|
||||||
|
// __debugbreak();
|
||||||
|
// }
|
||||||
Operand name = resolve_expr(node->name, inherit_flag(flags, AST_CANT_BE_NULL), 0, field_access_scope);
|
Operand name = resolve_expr(node->name, inherit_flag(flags, AST_CANT_BE_NULL), 0, field_access_scope);
|
||||||
if(name.type->kind != TYPE_LAMBDA){
|
if(name.type->kind != TYPE_LAMBDA){
|
||||||
compiler_error(node->pos, "Calling %Q which is not a [Lambda]", typestring(name.type));
|
compiler_error(node->pos, "Calling %Q which is not a [Lambda]", typestring(name.type));
|
||||||
|
|||||||
Reference in New Issue
Block a user