diff --git a/generator/transformers/common_producer.py b/generator/transformers/common_producer.py index 59dbac4c3..ae030faf7 100644 --- a/generator/transformers/common_producer.py +++ b/generator/transformers/common_producer.py @@ -32,7 +32,7 @@ def __init__(self, enum_names=(), struct_names=(), key_words=()): 'origin constructor_argument constructor_prefix deprecated mandatory since ' 'method_suffix of_class type_native type_sdl modifier for_name description ' 'constructor_argument_override') - self.constructor_named = namedtuple('constructor', 'init self arguments all deprecated') + self.constructor_named = namedtuple('constructor', 'init self arguments all') self.argument_named = namedtuple('argument', 'origin constructor_argument variable deprecated') self.names = self.struct_names + tuple(map(lambda e: self._replace_sync(e), enum_names)) @@ -215,8 +215,10 @@ def extract_constructors(self, data: dict) -> tuple: """ mandatory = [] not_mandatory = [] - deprecated = any([m.deprecated for m in data.values() if getattr(m, 'deprecated', False)]) for param in data.values(): + if param.deprecated: + # Omit deprecated parameters from the constructors + continue if param.mandatory: mandatory.append(param) else: @@ -225,13 +227,11 @@ def extract_constructors(self, data: dict) -> tuple: result = [] if mandatory: mandatory = self.extract_constructor(mandatory, True) - mandatory['deprecated'] = deprecated else: mandatory = OrderedDict() if not_mandatory: not_mandatory = self.extract_constructor(not_mandatory, False) - not_mandatory['deprecated'] = deprecated if mandatory: not_mandatory['init'] = '{} {}'.format(mandatory['init'], self.minimize_first(not_mandatory['init'])) not_mandatory['all'] = mandatory['arguments'] + not_mandatory['arguments']