| ... | ... | @@ -23279,6 +23279,22 @@ fn fieldVal( |
| 23279 | 23279 | Type.usize, |
| 23280 | 23280 | try Value.Tag.int_u64.create(arena, inner_ty.arrayLen()), |
| 23281 | 23281 | ); |
| 23282 | } else if (mem.eql(u8, field_name, "ptr") and is_pointer_to) { |
| 23283 | const ptr_info = object_ty.ptrInfo().data; |
| 23284 | const result_ty = try Type.ptr(sema.arena, sema.mod, .{ |
| 23285 | .pointee_type = ptr_info.pointee_type.childType(), |
| 23286 | .sentinel = ptr_info.sentinel, |
| 23287 | .@"align" = ptr_info.@"align", |
| 23288 | .@"addrspace" = ptr_info.@"addrspace", |
| 23289 | .bit_offset = ptr_info.bit_offset, |
| 23290 | .host_size = ptr_info.host_size, |
| 23291 | .vector_index = ptr_info.vector_index, |
| 23292 | .@"allowzero" = ptr_info.@"allowzero", |
| 23293 | .mutable = ptr_info.mutable, |
| 23294 | .@"volatile" = ptr_info.@"volatile", |
| 23295 | .size = .Many, |
| 23296 | }); |
| 23297 | return sema.coerce(block, result_ty, object, src); |
| 23282 | 23298 | } else { |
| 23283 | 23299 | return sema.fail( |
| 23284 | 23300 | block, |
| ... | ... | @@ -23311,20 +23327,6 @@ fn fieldVal( |
| 23311 | 23327 | .{ field_name, object_ty.fmt(sema.mod) }, |
| 23312 | 23328 | ); |
| 23313 | 23329 | } |
| 23314 | | } else if (ptr_info.pointee_type.zigTypeTag() == .Array) { |
| 23315 | | if (mem.eql(u8, field_name, "len")) { |
| 23316 | | return sema.addConstant( |
| 23317 | | Type.usize, |
| 23318 | | try Value.Tag.int_u64.create(arena, ptr_info.pointee_type.arrayLen()), |
| 23319 | | ); |
| 23320 | | } else { |
| 23321 | | return sema.fail( |
| 23322 | | block, |
| 23323 | | field_name_src, |
| 23324 | | "no member named '{s}' in '{}'", |
| 23325 | | .{ field_name, ptr_info.pointee_type.fmt(sema.mod) }, |
| 23326 | | ); |
| 23327 | | } |
| 23328 | 23330 | } |
| 23329 | 23331 | }, |
| 23330 | 23332 | .Type => { |