| author | |
| committer | |
| log | d353d5aef8bfc5c701ab8958751ef74f6704342b |
| tree | ebdd1d8f385db5056c903cc74f1ebf3f1f381b1d |
| parent | 68c1d059178a36add751e97e11cee004cfdf612e |
| signature |
closes #15512 files changed, 13 insertions(+), 0 deletions(-)
src/ir.cpp+3| ... | ... | @@ -18516,6 +18516,9 @@ static ZigType *ir_analyze_instruction_from_bytes(IrAnalyze *ira, IrInstructionF |
| 18516 | 18516 | src_ptr_align = get_abi_alignment(ira->codegen, target->value.type); |
| 18517 | 18517 | } |
| 18518 | 18518 | |
| 18519 | if ((err = type_resolve(ira->codegen, dest_child_type, ResolveStatusSizeKnown))) | |
| 18520 | return ira->codegen->builtin_types.entry_invalid; | |
| 18521 | ||
| 18519 | 18522 | ZigType *dest_ptr_type = get_pointer_to_type_extra(ira->codegen, dest_child_type, |
| 18520 | 18523 | src_ptr_const, src_ptr_volatile, PtrLenUnknown, |
| 18521 | 18524 | src_ptr_align, 0, 0); |
test/cases/eval.zig+10| ... | ... | @@ -700,3 +700,13 @@ test "@intCast to a u0" { |
| 700 | 700 | var y: u0 = @intCast(u0, x); |
| 701 | 701 | assert(y == 0); |
| 702 | 702 | } |
| 703 | ||
| 704 | test "@bytesToslice on a packed struct" { | |
| 705 | const F = packed struct { | |
| 706 | a: u8, | |
| 707 | }; | |
| 708 | ||
| 709 | var b = [1]u8{9}; | |
| 710 | var f = @bytesToSlice(F, b); | |
| 711 | assert(f[0].a == 9); | |
| 712 | } |