Bogdan Romanyuk

Results 11 comments of Bogdan Romanyuk

This pull request makes it possible to write code like this ```zig const bit: u1 = 0; label: switch (bit) { 0 => continue :label 1, 1 => continue :label...

> 1. that looks very difficult to detect in a reliable way Are you completely sure about that? At least the compiler is able to detect reaching unreachable code at...

> > It's obvious that such code results in infinite loop. So far I'm not quite sure if it will possible to compiler to infer this statically. > > You...

debug stack trace in ```0.12.0-dev.6294+cbf2b1fea``` ```thread 1997 panic: reached unreachable code Analyzing test.zig: test.zig:comptime_0 %2 = typeof_log2_int_type(@one) node_offset:2:19 to :2:20 %3 = as_shift_operand(%2, @one) node_offset:2:22 to :2:23 > %4 =...

> should this be a compile error since bit count is undefined for `comptime_int` ? It will break code like ```zig fn shlExact(any: anytype, shift_amt: anytype) @TypeOf(any) { return @shlExact(any,...

> ~yes. btw i'm only referring to the first argument so you'd have to do something like `@shlExact(@as(u32, 1), 1)` ?~ The original issue is rather trivial to fix for...

@leap0x7b what kind of error do we get there? Can you describe steps to reproduce this behaviour?

not sure if I should add test for this

![Screenshot_20240603_214413](https://github.com/ziglang/zig/assets/65823030/6e678a55-53b5-4286-ae95-98c38aa448e0)

> Please use `Type.structFieldName` and also update the equivalent code in `coerceTupleToTuple` to use it. > > I promise I'll merge this as soon as it passes the CI. Done....