preserve global resolved type properly
This commit is contained in:
@@ -6555,11 +6555,12 @@ prune_specs :: proc(checker: ^Checker) {
|
||||
if checker.entry_point == .Process {
|
||||
mark_spec_demanded(checker, find_spec(checker, checker.io_provider_template, nil), &stack)
|
||||
}
|
||||
for global in checker.ast_module.globals {
|
||||
for global, index in checker.ast_module.globals {
|
||||
if global.external || global.diagnostic != source.INVALID_DIAGNOSTIC {
|
||||
continue
|
||||
}
|
||||
_ = infer_expr(checker, global.expr, nil, global.pkg, global.file, &stack)
|
||||
expected := checker.global_types[index] if is_runtime_type(checker, checker.global_types[index]) else types.INVALID
|
||||
_ = infer_expr(checker, global.expr, nil, global.pkg, global.file, &stack, expected=expected)
|
||||
}
|
||||
for len(stack) > 0 {
|
||||
id := pop(&stack)
|
||||
|
||||
@@ -10,6 +10,8 @@ State :: struct {
|
||||
diagnostics std.ArrayList(ScanDiagnostic)
|
||||
}
|
||||
|
||||
arrlist_test std.ArrayList(Token) = arraylist.init(mem.c_allocator)
|
||||
|
||||
hide fail_alloc func(_ ?@mut anyopaque, _ usize, _ usize) ?*mut u8 {
|
||||
return none
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user