[APINotes] Document that Methods can now be nested under Tags

`Tags` can be nested under other `Tags`, which represents nested C++
classes.

`Methods` can be nested under `Tags`, which represents C++ methods.

rdar://151033780
This commit is contained in:
Egor Zhdan 2026-02-20 18:40:32 +00:00 committed by GitHub
parent 494bc4ca12
commit b117dc8a6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,6 +141,47 @@ Each entry under 'Classes' and 'Protocols' can contain "Methods" and
PropertyKind: Instance
Each entry under "Tags" can contain "Methods", "Fields", and nested "Tags"
arrays. Methods under Tags are C++ methods identified by 'Name' (rather than
'Selector' and 'MethodKind' as used for Objective-C methods).
:Methods (under Tags):
Identified by 'Name'.
::
Tags:
- Name: MyClass
Methods:
- Name: doSomething
:Fields:
Identified by 'Name'.
::
Tags:
- Name: MyStruct
Fields:
- Name: value
Nullability: O
:Tags (nested):
Nested tags follow the same schema as top-level Tags entries.
::
Tags:
- Name: OuterClass
Tags:
- Name: InnerClass
Each declaration supports the following annotations (if relevant to that
declaration kind), all of which are optional: