gohanlon / swift-memberwise-init-macro

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

Disallow `@Init(default:)` on already initialized variables #31

Closed gohanlon closed 11 months ago

gohanlon commented 11 months ago

Also, add several diagnostics and fix-its:

* ⚠️ @Init can't be applied to already initialized constant
  * ✏️ Remove '@Init'
  * ✏️ Remove '= 42'

* 🛑 @Init can't be applied to already initialized constant
  * ✏️ Remove '@Init(default: 0)'
  * ✏️ Remove '= 42'

* 🛑 Custom 'default' can't be applied to already initialized variable
  * ✏️ Remove 'default: 0'
  * ✏️ Remove '= 42'

* ⚠️ @Init can't be applied to 'static' members
  * ✏️ Remove '@Init'

* 🛑 Custom 'default' can't be applied to multiple bindings
  * ✏️ Remove '@Init(default: 42)'