From d98568f17bdbf160e4bfe3dcb4efe28bb67cb06a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 11 Jul 2022 13:50:03 -0400 Subject: [PATCH] Don't try to use to_underlying for non-enum C++ types. (#20554) Fixes https://github.com/project-chip/zap/issues/591 --- .../templates/partials/decodable_value.zapt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt index 0a9fa851f89dde..76a8e54369f509 100644 --- a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt +++ b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt @@ -27,7 +27,7 @@ {{>decodable_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) }} {{/zcl_struct_items_by_struct_name}} {{else}} - {{#if_chip_enum type}} + {{#if_is_strongly_typed_chip_enum type}} {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; {{else}} {{#if_is_strongly_typed_bitmap type}} @@ -39,6 +39,6 @@ {{else}} {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; {{/if_is_strongly_typed_bitmap}} - {{/if_chip_enum}} + {{/if_is_strongly_typed_chip_enum}} {{/if_is_struct}} {{/if}}