| ... | @@ -4076,11 +4076,18 @@ pub const Type = struct { | ... | @@ -4076,11 +4076,18 @@ pub const Type = struct { |
| 4076 | pub fn comptimeOnly(ty: Type, mod: *const Module) bool { | 4076 | pub fn comptimeOnly(ty: Type, mod: *const Module) bool { |
| 4077 | if (ty.ip_index != .none) return switch (mod.intern_pool.indexToKey(ty.ip_index)) { | 4077 | if (ty.ip_index != .none) return switch (mod.intern_pool.indexToKey(ty.ip_index)) { |
| 4078 | .int_type => false, | 4078 | .int_type => false, |
| 4079 | .ptr_type => @panic("TODO"), | 4079 | .ptr_type => |ptr_type| { |
| 4080 | .array_type => |array_type| return array_type.child.toType().comptimeOnly(mod), | 4080 | const child_ty = ptr_type.elem_type.toType(); |
| 4081 | .vector_type => |vector_type| return vector_type.child.toType().comptimeOnly(mod), | 4081 | if (child_ty.zigTypeTag(mod) == .Fn) { |
| 4082 | .opt_type => @panic("TODO"), | 4082 | return false; |
| 4083 | .error_union_type => @panic("TODO"), | 4083 | } else { |
| | 4084 | return child_ty.comptimeOnly(mod); |
| | 4085 | } |
| | 4086 | }, |
| | 4087 | .array_type => |array_type| array_type.child.toType().comptimeOnly(mod), |
| | 4088 | .vector_type => |vector_type| vector_type.child.toType().comptimeOnly(mod), |
| | 4089 | .opt_type => |child| child.toType().comptimeOnly(mod), |
| | 4090 | .error_union_type => |error_union_type| error_union_type.payload_type.toType().comptimeOnly(mod), |
| 4084 | .simple_type => |t| switch (t) { | 4091 | .simple_type => |t| switch (t) { |
| 4085 | .f16, | 4092 | .f16, |
| 4086 | .f32, | 4093 | .f32, |