swift
5d6746d9 - Improve checking of macro-generated accessors against documented names

Commit
1 year ago
Improve checking of macro-generated accessors against documented names The checking of the accessors generated by a macro against the documented set of accessors for the macro is slightly too strict and produces misleading error messages. Make the check slightly looser in the case where an observer-producing macro (such as `@ObservationIgnored`) is applied to a computed property. Here, we would diagnose that the observer did not in fact produce any observers, even though it couldn't have: computed properties don't get observers. Remove the diagnostic in this case. While here, add some tests and improve the wording of diagnostics a bit. Fixes rdar://113710199.
Author
Parents
  • include/swift/AST
    • File
      DiagnosticsSema.def
  • lib/Sema
    • File
      TypeCheckMacros.cpp
  • test
    • Macros
      • Inputs
        • File
          syntax_macro_definitions.swift
      • File
        accessor_macros.swift
    • Serialization
      • File
        macros.swift
    • stdlib/Observation
      • File
        Observable.swift