interpreter: allow KwargInfo.evolve to change the name as well

pull/9132/head
Dylan Baker 3 years ago
parent 5fe03cf8d9
commit d8d09138c7
  1. 3
      mesonbuild/interpreterbase/decorators.py

@ -339,6 +339,7 @@ class KwargInfo(T.Generic[_T]):
self.not_set_warning = not_set_warning
def evolve(self, *,
name: T.Union[str, _NULL_T] = _NULL,
required: T.Union[bool, _NULL_T] = _NULL,
listify: T.Union[bool, _NULL_T] = _NULL,
default: T.Union[_T, None, _NULL_T] = _NULL,
@ -360,7 +361,7 @@ class KwargInfo(T.Generic[_T]):
being replaced by either the copy in self, or the provided new version.
"""
return type(self)(
self.name,
name if not isinstance(name, _NULL_T) else self.name,
self.types,
listify=listify if not isinstance(listify, _NULL_T) else self.listify,
required=required if not isinstance(required, _NULL_T) else self.required,

Loading…
Cancel
Save