| ... | @@ -5729,6 +5729,28 @@ static bool can_mutate_comptime_var_state(ZigValue *value) { | ... | @@ -5729,6 +5729,28 @@ static bool can_mutate_comptime_var_state(ZigValue *value) { |
| 5729 | assert(value != nullptr); | 5729 | assert(value != nullptr); |
| 5730 | if (value->special == ConstValSpecialUndef) | 5730 | if (value->special == ConstValSpecialUndef) |
| 5731 | return false; | 5731 | return false; |
| | 5732 | |
| | 5733 | if (value->special == ConstValSpecialLazy) { |
| | 5734 | // No lazy value has side effects. |
| | 5735 | // Use a switch here to get a compile error whenever a new kind of lazy |
| | 5736 | // value is added. |
| | 5737 | switch (value->data.x_lazy->id) { |
| | 5738 | case LazyValueIdInvalid: |
| | 5739 | zig_unreachable(); |
| | 5740 | |
| | 5741 | case LazyValueIdAlignOf: |
| | 5742 | case LazyValueIdSizeOf: |
| | 5743 | case LazyValueIdPtrType: |
| | 5744 | case LazyValueIdOptType: |
| | 5745 | case LazyValueIdSliceType: |
| | 5746 | case LazyValueIdFnType: |
| | 5747 | case LazyValueIdErrUnionType: |
| | 5748 | case LazyValueIdArrayType: |
| | 5749 | case LazyValueIdTypeInfoDecls: |
| | 5750 | return false; |
| | 5751 | } |
| | 5752 | } |
| | 5753 | |
| 5732 | switch (value->type->id) { | 5754 | switch (value->type->id) { |
| 5733 | case ZigTypeIdInvalid: | 5755 | case ZigTypeIdInvalid: |
| 5734 | zig_unreachable(); | 5756 | zig_unreachable(); |