mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 03:03:09 +00:00
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.
This commit is contained in:
parent
cd43f323d2
commit
bf972e44d5
@ -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()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user