| ... | ... | @@ -30619,12 +30619,13 @@ fn analyzeIsNonErrComptimeOnly( |
| 30619 | 30619 | ies.func == func_index) |
| 30620 | 30620 | { |
| 30621 | 30621 | // Try to avoid resolving inferred error set if possible. |
| 30622 | | if (ies.errors.count() != 0) break :blk; |
| 30622 | if (ies.errors.count() != 0) return .none; |
| 30623 | 30623 | switch (ies.resolved) { |
| 30624 | | .anyerror_type => break :blk, |
| 30624 | .anyerror_type => return .none, |
| 30625 | 30625 | .none => {}, |
| 30626 | | else => if (ip.indexToKey(ies.resolved).error_set_type.names.len != 0) { |
| 30627 | | break :blk; |
| 30626 | else => switch (ip.indexToKey(ies.resolved).error_set_type.names.len) { |
| 30627 | 0 => return .bool_true, |
| 30628 | else => return .none, |
| 30628 | 30629 | }, |
| 30629 | 30630 | } |
| 30630 | 30631 | for (ies.inferred_error_sets.keys()) |other_ies_index| { |
| ... | ... | @@ -30633,10 +30634,10 @@ fn analyzeIsNonErrComptimeOnly( |
| 30633 | 30634 | try sema.resolveInferredErrorSet(block, src, other_ies_index); |
| 30634 | 30635 | if (other_resolved == .anyerror_type) { |
| 30635 | 30636 | ies.resolved = .anyerror_type; |
| 30636 | | break :blk; |
| 30637 | return .none; |
| 30637 | 30638 | } |
| 30638 | 30639 | if (ip.indexToKey(other_resolved).error_set_type.names.len != 0) |
| 30639 | | break :blk; |
| 30640 | return .none; |
| 30640 | 30641 | } |
| 30641 | 30642 | return .bool_true; |
| 30642 | 30643 | } |
| ... | ... | @@ -33113,16 +33114,21 @@ fn typeIsArrayLike(sema: *Sema, ty: Type) ?ArrayLike { |
| 33113 | 33114 | }; |
| 33114 | 33115 | } |
| 33115 | 33116 | |
| 33116 | | pub fn resolveFnTypes(sema: *Sema, block: *Block, src: LazySrcLoc, fn_ty: Type) CompileError!void { |
| 33117 | pub fn resolveIes(sema: *Sema, block: *Block, src: LazySrcLoc) CompileError!void { |
| 33117 | 33118 | const mod = sema.mod; |
| 33118 | 33119 | const ip = &mod.intern_pool; |
| 33119 | | const fn_ty_info = mod.typeToFunc(fn_ty).?; |
| 33120 | 33120 | |
| 33121 | 33121 | if (sema.fn_ret_ty_ies) |ies| { |
| 33122 | 33122 | try sema.resolveInferredErrorSetPtr(block, src, ies); |
| 33123 | 33123 | assert(ies.resolved != .none); |
| 33124 | 33124 | ip.funcIesResolved(sema.func_index).* = ies.resolved; |
| 33125 | 33125 | } |
| 33126 | } |
| 33127 | |
| 33128 | pub fn resolveFnTypes(sema: *Sema, fn_ty: Type) CompileError!void { |
| 33129 | const mod = sema.mod; |
| 33130 | const ip = &mod.intern_pool; |
| 33131 | const fn_ty_info = mod.typeToFunc(fn_ty).?; |
| 33126 | 33132 | |
| 33127 | 33133 | try sema.resolveTypeFully(fn_ty_info.return_type.toType()); |
| 33128 | 33134 | |
| ... | ... | @@ -34111,7 +34117,7 @@ fn resolveInferredErrorSet( |
| 34111 | 34117 | return final_resolved_ty; |
| 34112 | 34118 | } |
| 34113 | 34119 | |
| 34114 | | fn resolveInferredErrorSetPtr( |
| 34120 | pub fn resolveInferredErrorSetPtr( |
| 34115 | 34121 | sema: *Sema, |
| 34116 | 34122 | block: *Block, |
| 34117 | 34123 | src: LazySrcLoc, |