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

UseSynthesizedInitializer warns even if init has non-standard attributes attached #591

Closed
dnadoba opened this issue Aug 14, 2023 · 2 comments · Fixed by #592
Closed

UseSynthesizedInitializer warns even if init has non-standard attributes attached #591

dnadoba opened this issue Aug 14, 2023 · 2 comments · Fixed by #592
Labels
bug Something isn't working

Comments

@dnadoba
Copy link

dnadoba commented Aug 14, 2023

struct Foo {
    var bar: Int

    @inlinable // warning: [UseSynthesizedInitializer] remove initializer and use the synthesized initializer
    init(bar: Int) {
        self.bar = bar
    }
}

@inlinable is required or otherwise it can't be used in other @inlinable code. Therefore this should not warn as it is not equivalent to the synthesised init.

@dnadoba dnadoba added the bug Something isn't working label Aug 14, 2023
dnadoba added a commit to dnadoba/swift-certificates that referenced this issue Aug 14, 2023
allevato added a commit to allevato/swift-format that referenced this issue Aug 14, 2023
@allevato
Copy link
Member

Will be fixed by #592.

@dnadoba
Copy link
Author

dnadoba commented Aug 14, 2023

Very impressive report to fix time I must say! Thanks a lot again @allevato! Very appreciated

Lukasa pushed a commit to apple/swift-certificates that referenced this issue Aug 16, 2023
* Adopt `apple/swift-format`

* install swift-format

* set `UseSynthesizedInitializer` to `false` until bug is fixed swiftlang/swift-format#591

* fix license header

* Fix license header
allevato added a commit to allevato/swift-format that referenced this issue Sep 14, 2023
dnadoba added a commit to dnadoba/swift-certificates that referenced this issue Oct 16, 2023
dnadoba added a commit to apple/swift-certificates that referenced this issue Oct 16, 2023
* Align `swift-format` configuration with other projects

No code change. We already followed these rules.

* UseSynthesizedInitializer still needs to be set to false

The fix for swiftlang/swift-format#591 is not in `509.0.0` but only in `main`: swiftlang/swift-format@b896e0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants