mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Sema: handle adhoc inferred error sets in helper functions
There were two missing places. Regressed in the #16318 branch. Found from compiling Bun. Unfortunately we do not have a behavior test reduction for this bug.
This commit is contained in:
parent
012cbdb422
commit
c804abc7f6
1 changed files with 2 additions and 1 deletions
|
|
@ -2065,7 +2065,7 @@ pub const Type = struct {
|
||||||
pub fn errorSetIsEmpty(ty: Type, mod: *Module) bool {
|
pub fn errorSetIsEmpty(ty: Type, mod: *Module) bool {
|
||||||
const ip = &mod.intern_pool;
|
const ip = &mod.intern_pool;
|
||||||
return switch (ty.toIntern()) {
|
return switch (ty.toIntern()) {
|
||||||
.anyerror_type => false,
|
.anyerror_type, .adhoc_inferred_error_set_type => false,
|
||||||
else => switch (ip.indexToKey(ty.toIntern())) {
|
else => switch (ip.indexToKey(ty.toIntern())) {
|
||||||
.error_set_type => |error_set_type| error_set_type.names.len == 0,
|
.error_set_type => |error_set_type| error_set_type.names.len == 0,
|
||||||
.inferred_error_set_type => |i| switch (ip.funcIesResolved(i).*) {
|
.inferred_error_set_type => |i| switch (ip.funcIesResolved(i).*) {
|
||||||
|
|
@ -2084,6 +2084,7 @@ pub const Type = struct {
|
||||||
const ip = &mod.intern_pool;
|
const ip = &mod.intern_pool;
|
||||||
return switch (ty.toIntern()) {
|
return switch (ty.toIntern()) {
|
||||||
.anyerror_type => true,
|
.anyerror_type => true,
|
||||||
|
.adhoc_inferred_error_set_type => false,
|
||||||
else => switch (mod.intern_pool.indexToKey(ty.toIntern())) {
|
else => switch (mod.intern_pool.indexToKey(ty.toIntern())) {
|
||||||
.inferred_error_set_type => |i| ip.funcIesResolved(i).* == .anyerror_type,
|
.inferred_error_set_type => |i| ip.funcIesResolved(i).* == .anyerror_type,
|
||||||
else => false,
|
else => false,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue