From 252e6f47b10fa00a863fc85f11fe8a8e6c9893f4 Mon Sep 17 00:00:00 2001 From: fabriziobertoglio1987 Date: Mon, 14 Nov 2022 16:22:47 +0100 Subject: [PATCH] Call to implicitly deleted constructor [build error](https://www.icloud.com/iclouddrive/083j4A7FWBweG3wFmAnHzDyfQ#call_to_implicitly_deleted_constructor) seems to be caused by the double declaration of primitive AccessibilityUnit: --- .../react/renderer/attributedstring/TextAttributes.cpp | 2 +- ReactCommon/react/renderer/attributedstring/TextAttributes.h | 2 +- ReactCommon/react/renderer/attributedstring/primitives.h | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp b/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp index 741dcc85d4647f..90fc6513cd226d 100644 --- a/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +++ b/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp @@ -98,7 +98,7 @@ void TextAttributes::apply(TextAttributes textAttributes) { accessibilityRole = textAttributes.accessibilityRole.has_value() ? textAttributes.accessibilityRole : accessibilityRole; - accessibilityUnit = !textAttributes.accessibilityUnit.empty() ? textAttributes.accessibilityUnit + accessibilityUnit = !textAttributes.accessibilityUnit.has_value() ? textAttributes.accessibilityUnit : accessibilityUnit; } diff --git a/ReactCommon/react/renderer/attributedstring/TextAttributes.h b/ReactCommon/react/renderer/attributedstring/TextAttributes.h index 017e2d38e16ba9..4bf42586f5a173 100644 --- a/ReactCommon/react/renderer/attributedstring/TextAttributes.h +++ b/ReactCommon/react/renderer/attributedstring/TextAttributes.h @@ -79,7 +79,7 @@ class TextAttributes : public DebugStringConvertible { // construction. std::optional layoutDirection{}; std::optional accessibilityRole{}; - std::string accessibilityUnit{}; + AccessibilityUnit accessibilityUnit{}; #pragma mark - Operations diff --git a/ReactCommon/react/renderer/attributedstring/primitives.h b/ReactCommon/react/renderer/attributedstring/primitives.h index 39e8f31e18b4a6..69c7caffc4000e 100644 --- a/ReactCommon/react/renderer/attributedstring/primitives.h +++ b/ReactCommon/react/renderer/attributedstring/primitives.h @@ -135,6 +135,10 @@ enum class AccessibilityRole { Toolbar, }; +struct AccessibilityUnit { + std::string hours{""}; +}; + enum class TextTransform { None, Uppercase,