Closed jakubtomsu closed 1 week ago
oops forgot enums exist
Wait hold on, the reported error found a bug no? I might be wrong about this, but looking at this code sample I think it should be max(Layer_Data_Type)
instead of max(type)
? In practice this condition would never trigger because max(type)
just returns type
https://github.com/odin-lang/Odin/blob/b3b276c47388a8a86d003fcda414280ac9687147/core/encoding/hxa/read.odin#L118-L122
One parameter for
min
ormax
makes only sense when it's a type parameter. But when it's a regular numeric value (constant or variable), it's a no-op. I think in that case it's better to report an error to the user, because there is no practical reason to allow this and it makes it easier to notice a typo.I ran into this multiple times in cases where I wrote
foo = max(something)
instead offoo = max(foo, something_else)
to accumulate the maximum.