gohanlon / swift-memberwise-init-macro

Swift Macro for enhanced automatic inits.
MIT License
122 stars 8 forks source link

Diagnostic concerning custom 'label' on multiple bindings being misdiagnosed #20

Closed gohanlon closed 1 year ago

gohanlon commented 1 year ago

Description

This test is representative of the misdiagnosis:

  func testCustomInitEscapingWithMultipleBindings() {
    assertMacro {
      """
      @MemberwiseInit
      struct S {
        @Init(escaping: true)
        let v, r: T
      }
      """
    } diagnostics: {
      """
      @MemberwiseInit
      struct S {
        @Init(escaping: true)
        ┬────────────────────
        ╰─ 🛑 Custom 'label' can't be applied to multiple bindings
        let v, r: T
      }
      """
    }
  }

Other applications of @Init to multiple bindings are also affected.

Checklist

Expected behavior

Macro should expand without any diagnostics.

swift-memberwise-init-macro version information

0.2.0