From 0b1823ffe7c55632e98c3c71e92a9e6d264e4539 Mon Sep 17 00:00:00 2001 From: Torsten Zesch Date: Thu, 11 Jan 2024 20:59:06 +0100 Subject: [PATCH] More informative warning when feature is already defined in parent. --- cassis/typesystem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cassis/typesystem.py b/cassis/typesystem.py index 1a8a724..99000bc 100644 --- a/cassis/typesystem.py +++ b/cassis/typesystem.py @@ -646,10 +646,10 @@ def _add_feature(self, feature: Feature, inherited: bool = False, warn: bool = T redefined_feature = self._inherited_features[feature.name] if redefined_feature != feature: - msg = f"Feature with name [{feature.name}] already exists in parent but is redefined!" + msg = f"For type [{self.name}] feature with name [{feature.name}] already exists in parent [{self.supertype.name}] but is redefined!" raise ValueError(msg) elif warn: - msg = f"Feature with name [{feature.name}] already exists in parent!" + msg = f"For type [{self.name}] feature with name [{feature.name}] already exists in parent [{self.supertype.name}]!" warnings.warn(msg) return