diff --git a/xs/src/libslic3r/Config.hpp b/xs/src/libslic3r/Config.hpp
index e04f4df82..a58bb613a 100644
--- a/xs/src/libslic3r/Config.hpp
+++ b/xs/src/libslic3r/Config.hpp
@@ -582,6 +582,13 @@ public:
     ConfigOptionType            type()  const override { return static_type(); }
     ConfigOption*               clone() const override { return new ConfigOptionFloatOrPercent(*this); }
     ConfigOptionFloatOrPercent& operator=(const ConfigOption *opt) { this->set(opt); return *this; }
+    bool                        operator==(const ConfigOption &rhs) const override
+    {
+        if (rhs.type() != this->type())
+            throw std::runtime_error("ConfigOptionFloatOrPercent: Comparing incompatible types");
+        assert(dynamic_cast<const ConfigOptionFloatOrPercent*>(&rhs));
+        return *this == *static_cast<const ConfigOptionFloatOrPercent*>(&rhs);
+    }
     bool                        operator==(const ConfigOptionFloatOrPercent &rhs) const 
         { return this->value == rhs.value && this->percent == rhs.percent; }
     double                      get_abs_value(double ratio_over) const