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:
Mitchell Hashimoto 2022-03-05 12:12:45 -08:00 committed by Veikka Tuominen
parent cd43f323d2
commit bf972e44d5

View File

@ -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()) {