| ... | @@ -50,21 +50,20 @@ pub const Type = struct { | ... | @@ -50,21 +50,20 @@ pub const Type = struct { |
| 50 | .optional => return .Optional, | 50 | .optional => return .Optional, |
| 51 | | 51 | |
| 52 | .error_union => return .ErrorUnion, | 52 | .error_union => return .ErrorUnion, |
| 53 | | | |
| 54 | .anyframe_T => return .AnyFrame, | | |
| 55 | }, | 53 | }, |
| 56 | else => switch (mod.intern_pool.indexToKey(ty.ip_index)) { | 54 | else => return switch (mod.intern_pool.indexToKey(ty.ip_index)) { |
| 57 | .int_type => return .Int, | 55 | .int_type => .Int, |
| 58 | .ptr_type => return .Pointer, | 56 | .ptr_type => .Pointer, |
| 59 | .array_type => return .Array, | 57 | .array_type => .Array, |
| 60 | .vector_type => return .Vector, | 58 | .vector_type => .Vector, |
| 61 | .opt_type => return .Optional, | 59 | .opt_type => .Optional, |
| 62 | .error_union_type => return .ErrorUnion, | 60 | .error_union_type => .ErrorUnion, |
| 63 | .struct_type, .anon_struct_type => return .Struct, | 61 | .struct_type, .anon_struct_type => .Struct, |
| 64 | .union_type => return .Union, | 62 | .union_type => .Union, |
| 65 | .opaque_type => return .Opaque, | 63 | .opaque_type => .Opaque, |
| 66 | .enum_type => return .Enum, | 64 | .enum_type => .Enum, |
| 67 | .func_type => return .Fn, | 65 | .func_type => .Fn, |
| | 66 | .anyframe_type => .AnyFrame, |
| 68 | .simple_type => |s| switch (s) { | 67 | .simple_type => |s| switch (s) { |
| 69 | .f16, | 68 | .f16, |
| 70 | .f32, | 69 | .f32, |
| ... | @@ -72,7 +71,7 @@ pub const Type = struct { | ... | @@ -72,7 +71,7 @@ pub const Type = struct { |
| 72 | .f80, | 71 | .f80, |
| 73 | .f128, | 72 | .f128, |
| 74 | .c_longdouble, | 73 | .c_longdouble, |
| 75 | => return .Float, | 74 | => .Float, |
| 76 | | 75 | |
| 77 | .usize, | 76 | .usize, |
| 78 | .isize, | 77 | .isize, |
| ... | @@ -85,20 +84,19 @@ pub const Type = struct { | ... | @@ -85,20 +84,19 @@ pub const Type = struct { |
| 85 | .c_ulong, | 84 | .c_ulong, |
| 86 | .c_longlong, | 85 | .c_longlong, |
| 87 | .c_ulonglong, | 86 | .c_ulonglong, |
| 88 | => return .Int, | 87 | => .Int, |
| 89 | | 88 | |
| 90 | .anyopaque => return .Opaque, | 89 | .anyopaque => .Opaque, |
| 91 | .bool => return .Bool, | 90 | .bool => .Bool, |
| 92 | .void => return .Void, | 91 | .void => .Void, |
| 93 | .type => return .Type, | 92 | .type => .Type, |
| 94 | .anyerror => return .ErrorSet, | 93 | .anyerror => .ErrorSet, |
| 95 | .comptime_int => return .ComptimeInt, | 94 | .comptime_int => .ComptimeInt, |
| 96 | .comptime_float => return .ComptimeFloat, | 95 | .comptime_float => .ComptimeFloat, |
| 97 | .noreturn => return .NoReturn, | 96 | .noreturn => .NoReturn, |
| 98 | .@"anyframe" => return .AnyFrame, | 97 | .null => .Null, |
| 99 | .null => return .Null, | 98 | .undefined => .Undefined, |
| 100 | .undefined => return .Undefined, | 99 | .enum_literal => .EnumLiteral, |
| 101 | .enum_literal => return .EnumLiteral, | | |
| 102 | | 100 | |
| 103 | .atomic_order, | 101 | .atomic_order, |
| 104 | .atomic_rmw_op, | 102 | .atomic_rmw_op, |
| ... | @@ -107,14 +105,14 @@ pub const Type = struct { | ... | @@ -107,14 +105,14 @@ pub const Type = struct { |
| 107 | .float_mode, | 105 | .float_mode, |
| 108 | .reduce_op, | 106 | .reduce_op, |
| 109 | .call_modifier, | 107 | .call_modifier, |
| 110 | => return .Enum, | 108 | => .Enum, |
| 111 | | 109 | |
| 112 | .prefetch_options, | 110 | .prefetch_options, |
| 113 | .export_options, | 111 | .export_options, |
| 114 | .extern_options, | 112 | .extern_options, |
| 115 | => return .Struct, | 113 | => .Struct, |
| 116 | | 114 | |
| 117 | .type_info => return .Union, | 115 | .type_info => .Union, |
| 118 | | 116 | |
| 119 | .generic_poison => return error.GenericPoison, | 117 | .generic_poison => return error.GenericPoison, |
| 120 | .var_args_param => unreachable, | 118 | .var_args_param => unreachable, |
| ... | @@ -408,11 +406,6 @@ pub const Type = struct { | ... | @@ -408,11 +406,6 @@ pub const Type = struct { |
| 408 | | 406 | |
| 409 | return true; | 407 | return true; |
| 410 | }, | 408 | }, |
| 411 | | | |
| 412 | .anyframe_T => { | | |
| 413 | if (b.zigTypeTag(mod) != .AnyFrame) return false; | | |
| 414 | return a.elemType2(mod).eql(b.elemType2(mod), mod); | | |
| 415 | }, | | |
| 416 | } | 409 | } |
| 417 | } | 410 | } |
| 418 | | 411 | |
| ... | @@ -488,11 +481,6 @@ pub const Type = struct { | ... | @@ -488,11 +481,6 @@ pub const Type = struct { |
| 488 | const payload_ty = ty.errorUnionPayload(); | 481 | const payload_ty = ty.errorUnionPayload(); |
| 489 | hashWithHasher(payload_ty, hasher, mod); | 482 | hashWithHasher(payload_ty, hasher, mod); |
| 490 | }, | 483 | }, |
| 491 | | | |
| 492 | .anyframe_T => { | | |
| 493 | std.hash.autoHash(hasher, std.builtin.TypeId.AnyFrame); | | |
| 494 | hashWithHasher(ty.childType(mod), hasher, mod); | | |
| 495 | }, | | |
| 496 | } | 484 | } |
| 497 | } | 485 | } |
| 498 | | 486 | |
| ... | @@ -542,9 +530,7 @@ pub const Type = struct { | ... | @@ -542,9 +530,7 @@ pub const Type = struct { |
| 542 | .inferred_alloc_mut, | 530 | .inferred_alloc_mut, |
| 543 | => unreachable, | 531 | => unreachable, |
| 544 | | 532 | |
| 545 | .optional, | 533 | .optional => { |
| 546 | .anyframe_T, | | |
| 547 | => { | | |
| 548 | const payload = self.cast(Payload.ElemType).?; | 534 | const payload = self.cast(Payload.ElemType).?; |
| 549 | const new_payload = try allocator.create(Payload.ElemType); | 535 | const new_payload = try allocator.create(Payload.ElemType); |
| 550 | new_payload.* = .{ | 536 | new_payload.* = .{ |
| ... | @@ -668,12 +654,6 @@ pub const Type = struct { | ... | @@ -668,12 +654,6 @@ pub const Type = struct { |
| 668 | while (true) { | 654 | while (true) { |
| 669 | const t = ty.tag(); | 655 | const t = ty.tag(); |
| 670 | switch (t) { | 656 | switch (t) { |
| 671 | .anyframe_T => { | | |
| 672 | const return_type = ty.castTag(.anyframe_T).?.data; | | |
| 673 | try writer.print("anyframe->", .{}); | | |
| 674 | ty = return_type; | | |
| 675 | continue; | | |
| 676 | }, | | |
| 677 | .optional => { | 657 | .optional => { |
| 678 | const child_type = ty.castTag(.optional).?.data; | 658 | const child_type = ty.castTag(.optional).?.data; |
| 679 | try writer.writeByte('?'); | 659 | try writer.writeByte('?'); |
| ... | @@ -838,11 +818,6 @@ pub const Type = struct { | ... | @@ -838,11 +818,6 @@ pub const Type = struct { |
| 838 | try writer.writeByte('?'); | 818 | try writer.writeByte('?'); |
| 839 | try print(child_type, writer, mod); | 819 | try print(child_type, writer, mod); |
| 840 | }, | 820 | }, |
| 841 | .anyframe_T => { | | |
| 842 | const return_type = ty.castTag(.anyframe_T).?.data; | | |
| 843 | try writer.print("anyframe->", .{}); | | |
| 844 | try print(return_type, writer, mod); | | |
| 845 | }, | | |
| 846 | .error_set => { | 821 | .error_set => { |
| 847 | const names = ty.castTag(.error_set).?.data.names.keys(); | 822 | const names = ty.castTag(.error_set).?.data.names.keys(); |
| 848 | try writer.writeAll("error{"); | 823 | try writer.writeAll("error{"); |
| ... | @@ -1034,6 +1009,11 @@ pub const Type = struct { | ... | @@ -1034,6 +1009,11 @@ pub const Type = struct { |
| 1034 | try print(fn_info.return_type.toType(), writer, mod); | 1009 | try print(fn_info.return_type.toType(), writer, mod); |
| 1035 | } | 1010 | } |
| 1036 | }, | 1011 | }, |
| | 1012 | .anyframe_type => |child| { |
| | 1013 | if (child == .none) return writer.writeAll("anyframe"); |
| | 1014 | try writer.writeAll("anyframe->"); |
| | 1015 | return print(child.toType(), writer, mod); |
| | 1016 | }, |
| 1037 | | 1017 | |
| 1038 | // values, not types | 1018 | // values, not types |
| 1039 | .undef => unreachable, | 1019 | .undef => unreachable, |
| ... | @@ -1098,9 +1078,7 @@ pub const Type = struct { | ... | @@ -1098,9 +1078,7 @@ pub const Type = struct { |
| 1098 | | 1078 | |
| 1099 | // Pointers to zero-bit types still have a runtime address; however, pointers | 1079 | // Pointers to zero-bit types still have a runtime address; however, pointers |
| 1100 | // to comptime-only types do not, with the exception of function pointers. | 1080 | // to comptime-only types do not, with the exception of function pointers. |
| 1101 | .anyframe_T, | 1081 | .pointer => { |
| 1102 | .pointer, | | |
| 1103 | => { | | |
| 1104 | if (ignore_comptime_only) { | 1082 | if (ignore_comptime_only) { |
| 1105 | return true; | 1083 | return true; |
| 1106 | } else if (ty.childType(mod).zigTypeTag(mod) == .Fn) { | 1084 | } else if (ty.childType(mod).zigTypeTag(mod) == .Fn) { |
| ... | @@ -1141,6 +1119,7 @@ pub const Type = struct { | ... | @@ -1141,6 +1119,7 @@ pub const Type = struct { |
| 1141 | if (strat == .sema) return !(try strat.sema.typeRequiresComptime(ty)); | 1119 | if (strat == .sema) return !(try strat.sema.typeRequiresComptime(ty)); |
| 1142 | return !comptimeOnly(ty, mod); | 1120 | return !comptimeOnly(ty, mod); |
| 1143 | }, | 1121 | }, |
| | 1122 | .anyframe_type => true, |
| 1144 | .array_type => |array_type| { | 1123 | .array_type => |array_type| { |
| 1145 | if (array_type.sentinel != .none) { | 1124 | if (array_type.sentinel != .none) { |
| 1146 | return array_type.child.toType().hasRuntimeBitsAdvanced(mod, ignore_comptime_only, strat); | 1125 | return array_type.child.toType().hasRuntimeBitsAdvanced(mod, ignore_comptime_only, strat); |
| ... | @@ -1195,7 +1174,6 @@ pub const Type = struct { | ... | @@ -1195,7 +1174,6 @@ pub const Type = struct { |
| 1195 | .c_longdouble, | 1174 | .c_longdouble, |
| 1196 | .bool, | 1175 | .bool, |
| 1197 | .anyerror, | 1176 | .anyerror, |
| 1198 | .@"anyframe", | | |
| 1199 | .anyopaque, | 1177 | .anyopaque, |
| 1200 | .atomic_order, | 1178 | .atomic_order, |
| 1201 | .atomic_rmw_op, | 1179 | .atomic_rmw_op, |
| ... | @@ -1319,7 +1297,6 @@ pub const Type = struct { | ... | @@ -1319,7 +1297,6 @@ pub const Type = struct { |
| 1319 | .error_set_inferred, | 1297 | .error_set_inferred, |
| 1320 | .error_set_merged, | 1298 | .error_set_merged, |
| 1321 | .error_union, | 1299 | .error_union, |
| 1322 | .anyframe_T, | | |
| 1323 | => false, | 1300 | => false, |
| 1324 | | 1301 | |
| 1325 | .inferred_alloc_mut => unreachable, | 1302 | .inferred_alloc_mut => unreachable, |
| ... | @@ -1336,6 +1313,7 @@ pub const Type = struct { | ... | @@ -1336,6 +1313,7 @@ pub const Type = struct { |
| 1336 | .error_union_type, | 1313 | .error_union_type, |
| 1337 | .anon_struct_type, | 1314 | .anon_struct_type, |
| 1338 | .opaque_type, | 1315 | .opaque_type, |
| | 1316 | .anyframe_type, |
| 1339 | // These are function bodies, not function pointers. | 1317 | // These are function bodies, not function pointers. |
| 1340 | .func_type, | 1318 | .func_type, |
| 1341 | => false, | 1319 | => false, |
| ... | @@ -1366,7 +1344,6 @@ pub const Type = struct { | ... | @@ -1366,7 +1344,6 @@ pub const Type = struct { |
| 1366 | => true, | 1344 | => true, |
| 1367 | | 1345 | |
| 1368 | .anyerror, | 1346 | .anyerror, |
| 1369 | .@"anyframe", | | |
| 1370 | .anyopaque, | 1347 | .anyopaque, |
| 1371 | .atomic_order, | 1348 | .atomic_order, |
| 1372 | .atomic_rmw_op, | 1349 | .atomic_rmw_op, |
| ... | @@ -1594,9 +1571,7 @@ pub const Type = struct { | ... | @@ -1594,9 +1571,7 @@ pub const Type = struct { |
| 1594 | switch (ty.ip_index) { | 1571 | switch (ty.ip_index) { |
| 1595 | .empty_struct_type => return AbiAlignmentAdvanced{ .scalar = 0 }, | 1572 | .empty_struct_type => return AbiAlignmentAdvanced{ .scalar = 0 }, |
| 1596 | .none => switch (ty.tag()) { | 1573 | .none => switch (ty.tag()) { |
| 1597 | .pointer, | 1574 | .pointer => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, |
| 1598 | .anyframe_T, | | |
| 1599 | => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, | | |
| 1600 | | 1575 | |
| 1601 | // TODO revisit this when we have the concept of the error tag type | 1576 | // TODO revisit this when we have the concept of the error tag type |
| 1602 | .error_set_inferred, | 1577 | .error_set_inferred, |
| ... | @@ -1617,7 +1592,7 @@ pub const Type = struct { | ... | @@ -1617,7 +1592,7 @@ pub const Type = struct { |
| 1617 | if (int_type.bits == 0) return AbiAlignmentAdvanced{ .scalar = 0 }; | 1592 | if (int_type.bits == 0) return AbiAlignmentAdvanced{ .scalar = 0 }; |
| 1618 | return AbiAlignmentAdvanced{ .scalar = intAbiAlignment(int_type.bits, target) }; | 1593 | return AbiAlignmentAdvanced{ .scalar = intAbiAlignment(int_type.bits, target) }; |
| 1619 | }, | 1594 | }, |
| 1620 | .ptr_type => { | 1595 | .ptr_type, .anyframe_type => { |
| 1621 | return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }; | 1596 | return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }; |
| 1622 | }, | 1597 | }, |
| 1623 | .array_type => |array_type| { | 1598 | .array_type => |array_type| { |
| ... | @@ -1657,7 +1632,6 @@ pub const Type = struct { | ... | @@ -1657,7 +1632,6 @@ pub const Type = struct { |
| 1657 | .isize, | 1632 | .isize, |
| 1658 | .export_options, | 1633 | .export_options, |
| 1659 | .extern_options, | 1634 | .extern_options, |
| 1660 | .@"anyframe", | | |
| 1661 | => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, | 1635 | => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, |
| 1662 | | 1636 | |
| 1663 | .c_char => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.char) }, | 1637 | .c_char => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.char) }, |
| ... | @@ -1976,8 +1950,6 @@ pub const Type = struct { | ... | @@ -1976,8 +1950,6 @@ pub const Type = struct { |
| 1976 | .inferred_alloc_const => unreachable, | 1950 | .inferred_alloc_const => unreachable, |
| 1977 | .inferred_alloc_mut => unreachable, | 1951 | .inferred_alloc_mut => unreachable, |
| 1978 | | 1952 | |
| 1979 | .anyframe_T => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, | | |
| 1980 | | | |
| 1981 | .pointer => switch (ty.castTag(.pointer).?.data.size) { | 1953 | .pointer => switch (ty.castTag(.pointer).?.data.size) { |
| 1982 | .Slice => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) * 2 }, | 1954 | .Slice => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) * 2 }, |
| 1983 | else => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, | 1955 | else => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, |
| ... | @@ -2039,6 +2011,8 @@ pub const Type = struct { | ... | @@ -2039,6 +2011,8 @@ pub const Type = struct { |
| 2039 | .Slice => return .{ .scalar = @divExact(target.ptrBitWidth(), 8) * 2 }, | 2011 | .Slice => return .{ .scalar = @divExact(target.ptrBitWidth(), 8) * 2 }, |
| 2040 | else => return .{ .scalar = @divExact(target.ptrBitWidth(), 8) }, | 2012 | else => return .{ .scalar = @divExact(target.ptrBitWidth(), 8) }, |
| 2041 | }, | 2013 | }, |
| | 2014 | .anyframe_type => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, |
| | 2015 | |
| 2042 | .array_type => |array_type| { | 2016 | .array_type => |array_type| { |
| 2043 | const len = array_type.len + @boolToInt(array_type.sentinel != .none); | 2017 | const len = array_type.len + @boolToInt(array_type.sentinel != .none); |
| 2044 | switch (try array_type.child.toType().abiSizeAdvanced(mod, strat)) { | 2018 | switch (try array_type.child.toType().abiSizeAdvanced(mod, strat)) { |
| ... | @@ -2102,7 +2076,6 @@ pub const Type = struct { | ... | @@ -2102,7 +2076,6 @@ pub const Type = struct { |
| 2102 | | 2076 | |
| 2103 | .usize, | 2077 | .usize, |
| 2104 | .isize, | 2078 | .isize, |
| 2105 | .@"anyframe", | | |
| 2106 | => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, | 2079 | => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) }, |
| 2107 | | 2080 | |
| 2108 | .c_char => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.char) }, | 2081 | .c_char => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.char) }, |
| ... | @@ -2298,8 +2271,6 @@ pub const Type = struct { | ... | @@ -2298,8 +2271,6 @@ pub const Type = struct { |
| 2298 | .inferred_alloc_const => unreachable, | 2271 | .inferred_alloc_const => unreachable, |
| 2299 | .inferred_alloc_mut => unreachable, | 2272 | .inferred_alloc_mut => unreachable, |
| 2300 | | 2273 | |
| 2301 | .anyframe_T => return target.ptrBitWidth(), | | |
| 2302 | | | |
| 2303 | .pointer => switch (ty.castTag(.pointer).?.data.size) { | 2274 | .pointer => switch (ty.castTag(.pointer).?.data.size) { |
| 2304 | .Slice => return target.ptrBitWidth() * 2, | 2275 | .Slice => return target.ptrBitWidth() * 2, |
| 2305 | else => return target.ptrBitWidth(), | 2276 | else => return target.ptrBitWidth(), |
| ... | @@ -2323,6 +2294,8 @@ pub const Type = struct { | ... | @@ -2323,6 +2294,8 @@ pub const Type = struct { |
| 2323 | .Slice => return target.ptrBitWidth() * 2, | 2294 | .Slice => return target.ptrBitWidth() * 2, |
| 2324 | else => return target.ptrBitWidth() * 2, | 2295 | else => return target.ptrBitWidth() * 2, |
| 2325 | }, | 2296 | }, |
| | 2297 | .anyframe_type => return target.ptrBitWidth(), |
| | 2298 | |
| 2326 | .array_type => |array_type| { | 2299 | .array_type => |array_type| { |
| 2327 | const len = array_type.len + @boolToInt(array_type.sentinel != .none); | 2300 | const len = array_type.len + @boolToInt(array_type.sentinel != .none); |
| 2328 | if (len == 0) return 0; | 2301 | if (len == 0) return 0; |
| ... | @@ -2349,7 +2322,6 @@ pub const Type = struct { | ... | @@ -2349,7 +2322,6 @@ pub const Type = struct { |
| 2349 | | 2322 | |
| 2350 | .usize, | 2323 | .usize, |
| 2351 | .isize, | 2324 | .isize, |
| 2352 | .@"anyframe", | | |
| 2353 | => return target.ptrBitWidth(), | 2325 | => return target.ptrBitWidth(), |
| 2354 | | 2326 | |
| 2355 | .c_char => return target.c_type_bit_size(.char), | 2327 | .c_char => return target.c_type_bit_size(.char), |
| ... | @@ -2777,8 +2749,6 @@ pub const Type = struct { | ... | @@ -2777,8 +2749,6 @@ pub const Type = struct { |
| 2777 | }, | 2749 | }, |
| 2778 | .optional => ty.castTag(.optional).?.data.childType(mod), | 2750 | .optional => ty.castTag(.optional).?.data.childType(mod), |
| 2779 | | 2751 | |
| 2780 | .anyframe_T => ty.castTag(.anyframe_T).?.data, | | |
| 2781 | | | |
| 2782 | else => unreachable, | 2752 | else => unreachable, |
| 2783 | }, | 2753 | }, |
| 2784 | else => switch (mod.intern_pool.indexToKey(ty.ip_index)) { | 2754 | else => switch (mod.intern_pool.indexToKey(ty.ip_index)) { |
| ... | @@ -2786,6 +2756,10 @@ pub const Type = struct { | ... | @@ -2786,6 +2756,10 @@ pub const Type = struct { |
| 2786 | .One => ptr_type.elem_type.toType().shallowElemType(mod), | 2756 | .One => ptr_type.elem_type.toType().shallowElemType(mod), |
| 2787 | .Many, .C, .Slice => ptr_type.elem_type.toType(), | 2757 | .Many, .C, .Slice => ptr_type.elem_type.toType(), |
| 2788 | }, | 2758 | }, |
| | 2759 | .anyframe_type => |child| { |
| | 2760 | assert(child != .none); |
| | 2761 | return child.toType(); |
| | 2762 | }, |
| 2789 | .vector_type => |vector_type| vector_type.child.toType(), | 2763 | .vector_type => |vector_type| vector_type.child.toType(), |
| 2790 | .array_type => |array_type| array_type.child.toType(), | 2764 | .array_type => |array_type| array_type.child.toType(), |
| 2791 | .opt_type => |child| mod.intern_pool.childType(child).toType(), | 2765 | .opt_type => |child| mod.intern_pool.childType(child).toType(), |
| ... | @@ -3154,6 +3128,7 @@ pub const Type = struct { | ... | @@ -3154,6 +3128,7 @@ pub const Type = struct { |
| 3154 | .anon_struct_type => unreachable, | 3128 | .anon_struct_type => unreachable, |
| 3155 | | 3129 | |
| 3156 | .ptr_type => unreachable, | 3130 | .ptr_type => unreachable, |
| | 3131 | .anyframe_type => unreachable, |
| 3157 | .array_type => unreachable, | 3132 | .array_type => unreachable, |
| 3158 | | 3133 | |
| 3159 | .opt_type => unreachable, | 3134 | .opt_type => unreachable, |
| ... | @@ -3327,7 +3302,6 @@ pub const Type = struct { | ... | @@ -3327,7 +3302,6 @@ pub const Type = struct { |
| 3327 | .error_set, | 3302 | .error_set, |
| 3328 | .error_set_merged, | 3303 | .error_set_merged, |
| 3329 | .error_set_inferred, | 3304 | .error_set_inferred, |
| 3330 | .anyframe_T, | | |
| 3331 | .pointer, | 3305 | .pointer, |
| 3332 | => return null, | 3306 | => return null, |
| 3333 | | 3307 | |
| ... | @@ -3355,6 +3329,7 @@ pub const Type = struct { | ... | @@ -3355,6 +3329,7 @@ pub const Type = struct { |
| 3355 | .ptr_type, | 3329 | .ptr_type, |
| 3356 | .error_union_type, | 3330 | .error_union_type, |
| 3357 | .func_type, | 3331 | .func_type, |
| | 3332 | .anyframe_type, |
| 3358 | => return null, | 3333 | => return null, |
| 3359 | | 3334 | |
| 3360 | .array_type => |array_type| { | 3335 | .array_type => |array_type| { |
| ... | @@ -3401,7 +3376,6 @@ pub const Type = struct { | ... | @@ -3401,7 +3376,6 @@ pub const Type = struct { |
| 3401 | .anyerror, | 3376 | .anyerror, |
| 3402 | .comptime_int, | 3377 | .comptime_int, |
| 3403 | .comptime_float, | 3378 | .comptime_float, |
| 3404 | .@"anyframe", | | |
| 3405 | .enum_literal, | 3379 | .enum_literal, |
| 3406 | .atomic_order, | 3380 | .atomic_order, |
| 3407 | .atomic_rmw_op, | 3381 | .atomic_rmw_op, |
| ... | @@ -3555,10 +3529,6 @@ pub const Type = struct { | ... | @@ -3555,10 +3529,6 @@ pub const Type = struct { |
| 3555 | }, | 3529 | }, |
| 3556 | | 3530 | |
| 3557 | .error_union => return ty.errorUnionPayload().comptimeOnly(mod), | 3531 | .error_union => return ty.errorUnionPayload().comptimeOnly(mod), |
| 3558 | .anyframe_T => { | | |
| 3559 | const child_ty = ty.castTag(.anyframe_T).?.data; | | |
| 3560 | return child_ty.comptimeOnly(mod); | | |
| 3561 | }, | | |
| 3562 | }, | 3532 | }, |
| 3563 | else => switch (mod.intern_pool.indexToKey(ty.ip_index)) { | 3533 | else => switch (mod.intern_pool.indexToKey(ty.ip_index)) { |
| 3564 | .int_type => false, | 3534 | .int_type => false, |
| ... | @@ -3570,6 +3540,10 @@ pub const Type = struct { | ... | @@ -3570,6 +3540,10 @@ pub const Type = struct { |
| 3570 | return child_ty.comptimeOnly(mod); | 3540 | return child_ty.comptimeOnly(mod); |
| 3571 | } | 3541 | } |
| 3572 | }, | 3542 | }, |
| | 3543 | .anyframe_type => |child| { |
| | 3544 | if (child == .none) return false; |
| | 3545 | return child.toType().comptimeOnly(mod); |
| | 3546 | }, |
| 3573 | .array_type => |array_type| array_type.child.toType().comptimeOnly(mod), | 3547 | .array_type => |array_type| array_type.child.toType().comptimeOnly(mod), |
| 3574 | .vector_type => |vector_type| vector_type.child.toType().comptimeOnly(mod), | 3548 | .vector_type => |vector_type| vector_type.child.toType().comptimeOnly(mod), |
| 3575 | .opt_type => |child| child.toType().comptimeOnly(mod), | 3549 | .opt_type => |child| child.toType().comptimeOnly(mod), |
| ... | @@ -3599,7 +3573,6 @@ pub const Type = struct { | ... | @@ -3599,7 +3573,6 @@ pub const Type = struct { |
| 3599 | .bool, | 3573 | .bool, |
| 3600 | .void, | 3574 | .void, |
| 3601 | .anyerror, | 3575 | .anyerror, |
| 3602 | .@"anyframe", | | |
| 3603 | .noreturn, | 3576 | .noreturn, |
| 3604 | .generic_poison, | 3577 | .generic_poison, |
| 3605 | .atomic_order, | 3578 | .atomic_order, |
| ... | @@ -4245,7 +4218,6 @@ pub const Type = struct { | ... | @@ -4245,7 +4218,6 @@ pub const Type = struct { |
| 4245 | pointer, | 4218 | pointer, |
| 4246 | optional, | 4219 | optional, |
| 4247 | error_union, | 4220 | error_union, |
| 4248 | anyframe_T, | | |
| 4249 | error_set, | 4221 | error_set, |
| 4250 | error_set_single, | 4222 | error_set_single, |
| 4251 | /// The type is the inferred error set of a specific function. | 4223 | /// The type is the inferred error set of a specific function. |
| ... | @@ -4261,9 +4233,7 @@ pub const Type = struct { | ... | @@ -4261,9 +4233,7 @@ pub const Type = struct { |
| 4261 | .inferred_alloc_mut, | 4233 | .inferred_alloc_mut, |
| 4262 | => @compileError("Type Tag " ++ @tagName(t) ++ " has no payload"), | 4234 | => @compileError("Type Tag " ++ @tagName(t) ++ " has no payload"), |
| 4263 | | 4235 | |
| 4264 | .optional, | 4236 | .optional => Payload.ElemType, |
| 4265 | .anyframe_T, | | |
| 4266 | => Payload.ElemType, | | |
| 4267 | | 4237 | |
| 4268 | .error_set => Payload.ErrorSet, | 4238 | .error_set => Payload.ErrorSet, |
| 4269 | .error_set_inferred => Payload.ErrorSetInferred, | 4239 | .error_set_inferred => Payload.ErrorSetInferred, |