From e906f79b8b3b23a7186f3e3fae766abb97995223 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Tue, 25 Jun 2019 16:28:38 +0800 Subject: [PATCH 1/2] Fabric: make getDebugProps of YogaStylableProps as virtual method --- ReactCommon/fabric/components/view/yoga/YogaStylableProps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h b/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h index 6fa82ebe146fb6..9f3a04c75bfd7b 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h +++ b/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h @@ -38,7 +38,7 @@ class YogaStylableProps { #pragma mark - DebugStringConvertible (Partial) public: - SharedDebugStringConvertibleList getDebugProps() const; + virtual SharedDebugStringConvertibleList getDebugProps() const; #endif }; From e448bb9d1e53eceed1dfda1446823c2119ec8a8c Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Wed, 26 Jun 2019 12:30:05 +0800 Subject: [PATCH 2/2] Another try to use virtual inherit --- ReactCommon/fabric/components/view/yoga/YogaStylableProps.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h b/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h index 9f3a04c75bfd7b..c1572fcac06dc0 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h +++ b/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h @@ -19,7 +19,7 @@ class YogaStylableProps; typedef std::shared_ptr SharedYogaStylableProps; -class YogaStylableProps { +class YogaStylableProps : public virtual DebugStringConvertible { public: YogaStylableProps() = default; YogaStylableProps(const YGStyle &yogaStyle); @@ -38,7 +38,8 @@ class YogaStylableProps { #pragma mark - DebugStringConvertible (Partial) public: - virtual SharedDebugStringConvertibleList getDebugProps() const; + virtual ~YogaStylableProps() = default; + SharedDebugStringConvertibleList getDebugProps() const override; #endif };