mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-09 06:12:05 -04:00
Fix #7693 muted error follow-up lines; Fix distinct records against $T/Record constraints
This commit is contained in:
1 parent
38fa57e907
commit
8609eb3e4a
2 files changed
+16
No files matched your search
@@ -1865,6 +1865,11 @@ gb_internal SubstResult subst_unify_constraint(CheckerContext *c, Type *spec, Ty
|
||||
if (is_type_untyped(tb)) {
|
||||
r = subst_unify(c, spec, default_type(source), subst);
|
||||
} else if (sb->kind == Type_Struct || sb->kind == Type_Union) {
|
||||
if (tb == sb &&
|
||||
((tb->kind == Type_Struct && tb->Struct.polymorphic_parent == nullptr) ||
|
||||
(tb->kind == Type_Union && tb->Union.polymorphic_parent == nullptr))) {
|
||||
return Subst_Matched;
|
||||
}
|
||||
r = subst_unify(c, spec, source, subst); // record conformance keeps the Named types (match params)
|
||||
} else {
|
||||
r = subst_unify(c, sb, tb, subst); // general: base-typed structural match
|
||||
|
||||
@@ -251,6 +251,10 @@ gb_internal void print_all_errors(void);
|
||||
typedef ERROR_OUT_PROC(ErrorOutProc);
|
||||
|
||||
gb_internal ERROR_OUT_PROC(default_error_out_va) {
|
||||
if (global_error_mute_depth > 0) {
|
||||
// NOTE(bill): the error this would continue was muted, so there is no current error value
|
||||
return;
|
||||
}
|
||||
char buf[4096] = {};
|
||||
isize len = gb_snprintf_va(buf, gb_size_of(buf), fmt, va);
|
||||
isize n = len-1;
|
||||
@@ -765,10 +769,17 @@ gb_internal void warning_va(TokenPos const &pos, TokenPos end, char const *fmt,
|
||||
|
||||
|
||||
gb_internal void error_line_va(char const *fmt, va_list va) {
|
||||
if (global_error_mute_depth > 0) {
|
||||
return;
|
||||
}
|
||||
error_out_va(fmt, va);
|
||||
}
|
||||
|
||||
gb_internal void error_no_newline_va(TokenPos const &pos, char const *fmt, va_list va) {
|
||||
if (global_error_mute_depth > 0) {
|
||||
global_error_mute_count += 1;
|
||||
return;
|
||||
}
|
||||
global_error_collector.count.fetch_add(1);
|
||||
mutex_lock(&global_error_collector.mutex);
|
||||
if (global_error_collector.count.load() > MAX_ERROR_COLLECTOR_COUNT()) {
|
||||
|
||||
Reference in new issue
Block a user