Hi all,
I'm trying to implement a new attribute @_synthesized
in the compiler. Looking at other PRs, I added its definition to Attr.def
:
SIMPLE_DECL_ATTR(_synthesized, Synthesized,
OnFunc | OnVar | OnSubscript | OnConstructor |
UserInaccessible |
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIStableToRemove,
130)
I also added some diagnostics in DiagnosticsSema.def
and added it as an ignored attribute in TypeCheckAttr.cpp
:
// In class AttributeChecker:
IGNORED_ATTR(Synthesized)
Lastly, I made it an uninteresting attribute in TypeCheckDeclOverride.cpp
:
// In class AttributeOverrideChecker
UNINTERESTING_ATTR(Synthesized)
After these changes I get the error:
swift-project/swift/lib/Serialization/DeclTypeRecordNodes.def:149:1: error: duplicate case value: 'Synthesized_DECL_ATTR' and 'TUPLE_PATTERN' both equal '201'
PATTERN(TUPLE)
^
I've reviewed some PRs that implement new attributes again and again but couldn't find what I am doing wrong, so what am I missing?
Thanks in advance!