From 737ef3e81b4a417b3f81d54a419644fc8fb6b964 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 7 Apr 2022 22:58:50 -0700 Subject: [PATCH] Sema: remove unnecessary type resolution This causes false positive "foo depends on itself" errors. Prior to some recent enhancements, this type resolution was needed, however, we now have a more sophisticated type resolution mechanism that fully resolves types for the backend, but only after the Decl is fully analyzed, avoiding dependency loops. --- src/Sema.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Sema.zig b/src/Sema.zig index ae6d95ef96..503927f2a6 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -18026,8 +18026,7 @@ fn coerce( const array_ty = inst_ty.childType(); if (array_ty.zigTypeTag() != .Array) break :src_array_ptr; const len0 = array_ty.arrayLen() == 0; - // We resolve here so that the backend has the layout of the elem type. - const array_elem_type = try sema.resolveTypeFields(block, inst_src, array_ty.childType()); + const array_elem_type = array_ty.childType(); const dest_is_mut = dest_info.mutable; if (inst_ty.isConstPtr() and dest_is_mut and !len0) break :src_array_ptr; if (inst_ty.isVolatilePtr() and !dest_info.@"volatile") break :src_array_ptr;