| ... | @@ -32431,7 +32431,7 @@ fn optRefValue(sema: *Sema, opt_val: ?Value) !Value { | ... | @@ -32431,7 +32431,7 @@ fn optRefValue(sema: *Sema, opt_val: ?Value) !Value { |
| 32431 | return Value.fromInterned((try mod.intern(.{ .opt = .{ | 32431 | return Value.fromInterned((try mod.intern(.{ .opt = .{ |
| 32432 | .ty = (try mod.optionalType(ptr_anyopaque_ty.toIntern())).toIntern(), | 32432 | .ty = (try mod.optionalType(ptr_anyopaque_ty.toIntern())).toIntern(), |
| 32433 | .val = if (opt_val) |val| (try mod.getCoerced( | 32433 | .val = if (opt_val) |val| (try mod.getCoerced( |
| 32434 | Value.fromInterned((try sema.refValue(val.toIntern()))), | 32434 | Value.fromInterned(try sema.refValue(val.toIntern())), |
| 32435 | ptr_anyopaque_ty, | 32435 | ptr_anyopaque_ty, |
| 32436 | )).toIntern() else .none, | 32436 | )).toIntern() else .none, |
| 32437 | } }))); | 32437 | } }))); |
| ... | @@ -36952,7 +36952,7 @@ fn semaStructFieldInits( | ... | @@ -36952,7 +36952,7 @@ fn semaStructFieldInits( |
| 36952 | }); | 36952 | }); |
| 36953 | }; | 36953 | }; |
| 36954 | | 36954 | |
| 36955 | if (Value.fromInterned(default_val.toIntern()).canMutateComptimeVarState(mod)) { | 36955 | if (default_val.canMutateComptimeVarState(mod)) { |
| 36956 | const init_src = mod.fieldSrcLoc(decl_index, .{ | 36956 | const init_src = mod.fieldSrcLoc(decl_index, .{ |
| 36957 | .index = field_i, | 36957 | .index = field_i, |
| 36958 | .range = .value, | 36958 | .range = .value, |
| ... | @@ -39050,11 +39050,11 @@ fn sliceToIpString( | ... | @@ -39050,11 +39050,11 @@ fn sliceToIpString( |
| 39050 | ) CompileError!InternPool.NullTerminatedString { | 39050 | ) CompileError!InternPool.NullTerminatedString { |
| 39051 | const zcu = sema.mod; | 39051 | const zcu = sema.mod; |
| 39052 | const ip = &zcu.intern_pool; | 39052 | const ip = &zcu.intern_pool; |
| 39053 | const slice_ty = Type.fromInterned(ip.typeOf(slice_val.toIntern())); | 39053 | const slice_ty = slice_val.typeOf(zcu); |
| 39054 | assert(slice_ty.isSlice(zcu)); | 39054 | assert(slice_ty.isSlice(zcu)); |
| 39055 | assert(slice_ty.childType(zcu).toIntern() == .u8_type); | 39055 | assert(slice_ty.childType(zcu).toIntern() == .u8_type); |
| 39056 | const array_val = try sema.derefSliceAsArray(block, src, slice_val, reason); | 39056 | const array_val = try sema.derefSliceAsArray(block, src, slice_val, reason); |
| 39057 | const array_ty = Type.fromInterned(ip.typeOf(array_val.toIntern())); | 39057 | const array_ty = array_val.typeOf(zcu); |
| 39058 | return array_val.toIpString(array_ty, zcu); | 39058 | return array_val.toIpString(array_ty, zcu); |
| 39059 | } | 39059 | } |
| 39060 | | 39060 | |
| ... | @@ -39084,7 +39084,7 @@ fn maybeDerefSliceAsArray( | ... | @@ -39084,7 +39084,7 @@ fn maybeDerefSliceAsArray( |
| 39084 | ) CompileError!?Value { | 39084 | ) CompileError!?Value { |
| 39085 | const zcu = sema.mod; | 39085 | const zcu = sema.mod; |
| 39086 | const ip = &zcu.intern_pool; | 39086 | const ip = &zcu.intern_pool; |
| 39087 | assert(Type.fromInterned(ip.typeOf(slice_val.toIntern())).isSlice(zcu)); | 39087 | assert(slice_val.typeOf(zcu).isSlice(zcu)); |
| 39088 | const slice = switch (ip.indexToKey(slice_val.toIntern())) { | 39088 | const slice = switch (ip.indexToKey(slice_val.toIntern())) { |
| 39089 | .undef => return sema.failWithUseOfUndef(block, src), | 39089 | .undef => return sema.failWithUseOfUndef(block, src), |
| 39090 | .slice => |slice| slice, | 39090 | .slice => |slice| slice, |