Skip to content

Change message of invalid_iboutlet and invalid_ibinspectable to reflect accurate usage #59198

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

Merged
merged 2 commits into from
Jun 4, 2022
Merged

Change message of invalid_iboutlet and invalid_ibinspectable to reflect accurate usage #59198

merged 2 commits into from
Jun 4, 2022

Conversation

NSAntoine
Copy link
Contributor

The current error message for when @GKInspectable, @IBInspectable, and @IBOutlet is only instance properties can be declared @GKInspectable / @IBInspectable / @IBOutlet, however it doesn't reflect that it should be an instance property of a class, just that it should be an instance property, though those attributes are only allowed to be used for instance properties of a class type.

This pull request changes the message so that it should reflect the attribute should be used on a class instance property.

@NSAntoine
Copy link
Contributor Author

@AnthonyLatsis This one is simple and should work the first time, could you ask it to test? :)

@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test macOS

@AnthonyLatsis
Copy link
Collaborator

Looks like those two error macros are pretty much identical, and we can get rid of the one that hardcodes IBOutlet in favor of the other one that takes a string argument, and pass attr->getName for IBOutletAttr. Do you mind cleaning that up as well?

@NSAntoine
Copy link
Contributor Author

Looks like those two error macros are pretty much identical, and we can get rid of the one that hardcodes IBOutlet in favor of the other one that takes a string argument, and pass attr->getName for IBOutletAttr. Do you mind cleaning that up as well?

I noticed this yesterday and wanted to replace the hardcoded one but thought maybe I shouldn’t overcomplicate the pr but it should be fine now that I think about it, I’ll do it once I’m near my computer again

@NSAntoine
Copy link
Contributor Author

@AnthonyLatsis

Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@AnthonyLatsis AnthonyLatsis requested a review from hborla June 1, 2022 18:46
@NSAntoine
Copy link
Contributor Author

@AnthonyLatsis may be redundant but shouldn’t we run tests just one more time to make sure nothing got messed up?

@AnthonyLatsis
Copy link
Collaborator

Sure.

@swift-ci please smoke test macOS

Copy link
Member

@hborla hborla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement!

@hborla
Copy link
Member

hborla commented Jun 3, 2022

@swift-ci please smoke test

@AnthonyLatsis
Copy link
Collaborator

@SerenaKit Before we merge, could you rebase this into 2 commits, one for the message edit and another one for the gardening? Would also be nice if the second commit message was a tad more specific.

@NSAntoine
Copy link
Contributor Author

@AnthonyLatsis There, should be fine now (I think)

@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit c2b7d82 into swiftlang:main Jun 4, 2022
@NSAntoine NSAntoine deleted the serena/update-IBInspectable-message branch June 4, 2022 12:44
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.

4 participants