| ... | @@ -5749,6 +5749,28 @@ static bool can_mutate_comptime_var_state(ZigValue *value) { | ... | @@ -5749,6 +5749,28 @@ static bool can_mutate_comptime_var_state(ZigValue *value) { |
| 5749 | assert(value != nullptr); | 5749 | assert(value != nullptr); |
| 5750 | if (value->special == ConstValSpecialUndef) | 5750 | if (value->special == ConstValSpecialUndef) |
| 5751 | return false; | 5751 | return false; |
| | 5752 | |
| | 5753 | if (value->special == ConstValSpecialLazy) { |
| | 5754 | // No lazy value has side effects. |
| | 5755 | // Use a switch here to get a compile error whenever a new kind of lazy |
| | 5756 | // value is added. |
| | 5757 | switch (value->data.x_lazy->id) { |
| | 5758 | case LazyValueIdInvalid: |
| | 5759 | zig_unreachable(); |
| | 5760 | |
| | 5761 | case LazyValueIdAlignOf: |
| | 5762 | case LazyValueIdSizeOf: |
| | 5763 | case LazyValueIdPtrType: |
| | 5764 | case LazyValueIdOptType: |
| | 5765 | case LazyValueIdSliceType: |
| | 5766 | case LazyValueIdFnType: |
| | 5767 | case LazyValueIdErrUnionType: |
| | 5768 | case LazyValueIdArrayType: |
| | 5769 | case LazyValueIdTypeInfoDecls: |
| | 5770 | return false; |
| | 5771 | } |
| | 5772 | } |
| | 5773 | |
| 5752 | switch (value->type->id) { | 5774 | switch (value->type->id) { |
| 5753 | case ZigTypeIdInvalid: | 5775 | case ZigTypeIdInvalid: |
| 5754 | zig_unreachable(); | 5776 | zig_unreachable(); |