| author | |
| committer | |
| log | 26dfbf8122618de865e847bed18554f6b023198a |
| tree | ad815687c156f736741f28dd8ff368b06c019af1 |
| parent | f6bd534fc9ccbb45d6dfbcaf51eccd2967856661 |
1 files changed, 5 insertions(+), 1 deletions(-)
src/type.zig+5-1| ... | ... | @@ -4511,7 +4511,11 @@ pub const Type = extern union { |
| 4511 | 4511 | .enum_full => { |
| 4512 | 4512 | const enum_full = ty.castTag(.enum_full).?.data; |
| 4513 | 4513 | if (enum_full.fields.count() == 1) { |
| 4514 | return enum_full.values.keys()[0]; | |
| 4514 | if (enum_full.values.count() == 0) { | |
| 4515 | return Value.zero; | |
| 4516 | } else { | |
| 4517 | return enum_full.values.keys()[0]; | |
| 4518 | } | |
| 4515 | 4519 | } else { |
| 4516 | 4520 | return null; |
| 4517 | 4521 | } |