zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit bf972e44d5d0ce704cae99957d565c55ea16335d (tree)
parent cd43f323d28e66d11273425cc6debcce735c33e2
Author: Mitchell Hashimoto <mitchell.hashimoto@gmail.com>
Date:   Sat,  5 Mar 2022 12:12:45 -0800

stage2: coerce [*:0]u8 to other valid pointer types

This makes the following work properly (as it does in stage1, too):

  var zero_ptr: [*:0]const u8 = undefined;
  var no_zero_ptr: [*]const u8 = zero_ptr;

Prior to this this would fail with an "expected type" error since
coercion failed.

Diffstat:
Msrc/Sema.zig | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/Sema.zig b/src/Sema.zig @@ -19939,6 +19939,7 @@ fn typePtrOrOptionalPtrTy( .many_mut_pointer, .manyptr_u8, .manyptr_const_u8, + .manyptr_const_u8_sentinel_0, => return ty, .pointer => switch (ty.ptrSize()) {