Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

gohanlon
Copy link
Owner

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)'

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)'
```
@gohanlon gohanlon self-assigned this Dec 15, 2023
@gohanlon gohanlon merged commit 46096aa into main Dec 15, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant