mem.eql (stdlib)
This commit is contained in:
@@ -1350,6 +1350,20 @@ match_inferred_type_pattern :: proc(
|
||||
return matched
|
||||
}
|
||||
actual_item, actual_ok := types.node(store, actual_type)
|
||||
if pattern_item.kind == .Slice {
|
||||
actual_pointer, actual_array, array_pointer_ok := types.array_pointer(actual_type, store)
|
||||
if array_pointer_ok {
|
||||
mutable := actual_pointer.mutable && actual_array.mutable
|
||||
if pattern_item.mutable && !mutable ||
|
||||
pattern_item.has_sentinel && (!actual_array.has_sentinel || pattern_item.sentinel != actual_array.sentinel) {
|
||||
return false
|
||||
}
|
||||
return match_inferred_type_pattern(
|
||||
checker, function, prefix, pattern_item.child, actual_array.child,
|
||||
values, bound, span, diagnose, depth+1,
|
||||
)
|
||||
}
|
||||
}
|
||||
if !actual_ok || pattern_item.kind != actual_item.kind {
|
||||
resolved := type_from_syntax(checker, pattern, function.pkg, function.file)
|
||||
return types.is_valid(resolved) && types.equal(types.resolve_alias(resolved, store), actual_type)
|
||||
|
||||
Reference in New Issue
Block a user