| ... | ... | @@ -31373,6 +31373,7 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool { |
| 31373 | 31373 | .error_union_type => @panic("TODO"), |
| 31374 | 31374 | .simple_type => @panic("TODO"), |
| 31375 | 31375 | .struct_type => @panic("TODO"), |
| 31376 | .union_type => @panic("TODO"), |
| 31376 | 31377 | .simple_value => unreachable, |
| 31377 | 31378 | .extern_func => unreachable, |
| 31378 | 31379 | .int => unreachable, |
| ... | ... | @@ -31660,30 +31661,118 @@ fn resolveUnionFully(sema: *Sema, ty: Type) CompileError!void { |
| 31660 | 31661 | } |
| 31661 | 31662 | |
| 31662 | 31663 | pub fn resolveTypeFields(sema: *Sema, ty: Type) CompileError!Type { |
| 31663 | | switch (ty.tag()) { |
| 31664 | | .@"struct" => { |
| 31665 | | const struct_obj = ty.castTag(.@"struct").?.data; |
| 31666 | | try sema.resolveTypeFieldsStruct(ty, struct_obj); |
| 31667 | | return ty; |
| 31668 | | }, |
| 31669 | | .@"union", .union_safety_tagged, .union_tagged => { |
| 31670 | | const union_obj = ty.cast(Type.Payload.Union).?.data; |
| 31671 | | try sema.resolveTypeFieldsUnion(ty, union_obj); |
| 31672 | | return ty; |
| 31664 | const mod = sema.mod; |
| 31665 | |
| 31666 | switch (ty.ip_index) { |
| 31667 | .none => switch (ty.tag()) { |
| 31668 | .@"struct" => { |
| 31669 | const struct_obj = ty.castTag(.@"struct").?.data; |
| 31670 | try sema.resolveTypeFieldsStruct(ty, struct_obj); |
| 31671 | return ty; |
| 31672 | }, |
| 31673 | .@"union", .union_safety_tagged, .union_tagged => { |
| 31674 | const union_obj = ty.cast(Type.Payload.Union).?.data; |
| 31675 | try sema.resolveTypeFieldsUnion(ty, union_obj); |
| 31676 | return ty; |
| 31677 | }, |
| 31678 | .type_info => return sema.getBuiltinType("Type"), |
| 31679 | .extern_options => return sema.getBuiltinType("ExternOptions"), |
| 31680 | .export_options => return sema.getBuiltinType("ExportOptions"), |
| 31681 | .atomic_order => return sema.getBuiltinType("AtomicOrder"), |
| 31682 | .atomic_rmw_op => return sema.getBuiltinType("AtomicRmwOp"), |
| 31683 | .calling_convention => return sema.getBuiltinType("CallingConvention"), |
| 31684 | .address_space => return sema.getBuiltinType("AddressSpace"), |
| 31685 | .float_mode => return sema.getBuiltinType("FloatMode"), |
| 31686 | .reduce_op => return sema.getBuiltinType("ReduceOp"), |
| 31687 | .modifier => return sema.getBuiltinType("CallModifier"), |
| 31688 | .prefetch_options => return sema.getBuiltinType("PrefetchOptions"), |
| 31689 | |
| 31690 | else => return ty, |
| 31673 | 31691 | }, |
| 31674 | | .type_info => return sema.getBuiltinType("Type"), |
| 31675 | | .extern_options => return sema.getBuiltinType("ExternOptions"), |
| 31676 | | .export_options => return sema.getBuiltinType("ExportOptions"), |
| 31677 | | .atomic_order => return sema.getBuiltinType("AtomicOrder"), |
| 31678 | | .atomic_rmw_op => return sema.getBuiltinType("AtomicRmwOp"), |
| 31679 | | .calling_convention => return sema.getBuiltinType("CallingConvention"), |
| 31680 | | .address_space => return sema.getBuiltinType("AddressSpace"), |
| 31681 | | .float_mode => return sema.getBuiltinType("FloatMode"), |
| 31682 | | .reduce_op => return sema.getBuiltinType("ReduceOp"), |
| 31683 | | .modifier => return sema.getBuiltinType("CallModifier"), |
| 31684 | | .prefetch_options => return sema.getBuiltinType("PrefetchOptions"), |
| 31685 | 31692 | |
| 31686 | | else => return ty, |
| 31693 | .u1_type, |
| 31694 | .u8_type, |
| 31695 | .i8_type, |
| 31696 | .u16_type, |
| 31697 | .i16_type, |
| 31698 | .u29_type, |
| 31699 | .u32_type, |
| 31700 | .i32_type, |
| 31701 | .u64_type, |
| 31702 | .i64_type, |
| 31703 | .u80_type, |
| 31704 | .u128_type, |
| 31705 | .i128_type, |
| 31706 | .usize_type, |
| 31707 | .isize_type, |
| 31708 | .c_char_type, |
| 31709 | .c_short_type, |
| 31710 | .c_ushort_type, |
| 31711 | .c_int_type, |
| 31712 | .c_uint_type, |
| 31713 | .c_long_type, |
| 31714 | .c_ulong_type, |
| 31715 | .c_longlong_type, |
| 31716 | .c_ulonglong_type, |
| 31717 | .c_longdouble_type, |
| 31718 | .f16_type, |
| 31719 | .f32_type, |
| 31720 | .f64_type, |
| 31721 | .f80_type, |
| 31722 | .f128_type, |
| 31723 | .anyopaque_type, |
| 31724 | .bool_type, |
| 31725 | .void_type, |
| 31726 | .type_type, |
| 31727 | .anyerror_type, |
| 31728 | .comptime_int_type, |
| 31729 | .comptime_float_type, |
| 31730 | .noreturn_type, |
| 31731 | .anyframe_type, |
| 31732 | .null_type, |
| 31733 | .undefined_type, |
| 31734 | .enum_literal_type, |
| 31735 | .manyptr_u8_type, |
| 31736 | .manyptr_const_u8_type, |
| 31737 | .single_const_pointer_to_comptime_int_type, |
| 31738 | .const_slice_u8_type, |
| 31739 | .anyerror_void_error_union_type, |
| 31740 | .generic_poison_type, |
| 31741 | .empty_struct_type, |
| 31742 | => return ty, |
| 31743 | |
| 31744 | .undef => unreachable, |
| 31745 | .zero => unreachable, |
| 31746 | .zero_usize => unreachable, |
| 31747 | .one => unreachable, |
| 31748 | .one_usize => unreachable, |
| 31749 | .calling_convention_c => unreachable, |
| 31750 | .calling_convention_inline => unreachable, |
| 31751 | .void_value => unreachable, |
| 31752 | .unreachable_value => unreachable, |
| 31753 | .null_value => unreachable, |
| 31754 | .bool_true => unreachable, |
| 31755 | .bool_false => unreachable, |
| 31756 | .empty_struct => unreachable, |
| 31757 | .generic_poison => unreachable, |
| 31758 | |
| 31759 | .type_info_type => return sema.getBuiltinType("Type"), |
| 31760 | .extern_options_type => return sema.getBuiltinType("ExternOptions"), |
| 31761 | .export_options_type => return sema.getBuiltinType("ExportOptions"), |
| 31762 | .atomic_order_type => return sema.getBuiltinType("AtomicOrder"), |
| 31763 | .atomic_rmw_op_type => return sema.getBuiltinType("AtomicRmwOp"), |
| 31764 | .calling_convention_type => return sema.getBuiltinType("CallingConvention"), |
| 31765 | .address_space_type => return sema.getBuiltinType("AddressSpace"), |
| 31766 | .float_mode_type => return sema.getBuiltinType("FloatMode"), |
| 31767 | .reduce_op_type => return sema.getBuiltinType("ReduceOp"), |
| 31768 | .call_modifier_type => return sema.getBuiltinType("CallModifier"), |
| 31769 | .prefetch_options_type => return sema.getBuiltinType("PrefetchOptions"), |
| 31770 | |
| 31771 | _ => switch (mod.intern_pool.indexToKey(ty.ip_index)) { |
| 31772 | .struct_type => @panic("TODO"), |
| 31773 | .union_type => @panic("TODO"), |
| 31774 | else => return ty, |
| 31775 | }, |
| 31687 | 31776 | } |
| 31688 | 31777 | } |
| 31689 | 31778 | |
| ... | ... | @@ -32824,6 +32913,7 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value { |
| 32824 | 32913 | .var_args_param => unreachable, |
| 32825 | 32914 | }, |
| 32826 | 32915 | .struct_type => @panic("TODO"), |
| 32916 | .union_type => @panic("TODO"), |
| 32827 | 32917 | .simple_value => unreachable, |
| 32828 | 32918 | .extern_func => unreachable, |
| 32829 | 32919 | .int => unreachable, |
| ... | ... | @@ -33475,6 +33565,7 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool { |
| 33475 | 33565 | .error_union_type => @panic("TODO"), |
| 33476 | 33566 | .simple_type => @panic("TODO"), |
| 33477 | 33567 | .struct_type => @panic("TODO"), |
| 33568 | .union_type => @panic("TODO"), |
| 33478 | 33569 | .simple_value => unreachable, |
| 33479 | 33570 | .extern_func => unreachable, |
| 33480 | 33571 | .int => unreachable, |