Skip to content

Revert "[CSDiagnostics] Don't mention special names in requirement diagnostics" #19468

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

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Sep 21, 2018

Reverts #19447

@xedin
Copy link
Contributor Author

xedin commented Sep 21, 2018

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Sep 21, 2018

@jrose-apple Maybe this is not actually worth reverting because note is going to point to declaration in question, with one caveat - if it's implicit initializer it would point to the type where requirement was declared...

@jrose-apple
Copy link
Contributor

In plenty of contexts notes might not be displayed without clicking into an error, and in the case of Xcode they're often not displayed at all today. :-( The main error should be informative without having to do that.

If you want to clean up the obviously useless cases, you could say "if there's a special name and zero or one unlabeled parameters" as your condition or something.

@xedin
Copy link
Contributor Author

xedin commented Sep 21, 2018

Sure, that makes sense, I'll change the condition to only print names if they have at least one label instead of reverting.

@xedin xedin closed this Sep 21, 2018
@jrose-apple
Copy link
Contributor

Ah, that's not quite the condition I was saying. If you have two unlabeled parameters, it would be good to know that you have an unusual subscript / non-converting initializer. (Even zero vs. one parameters for an init might still be interesting.)

@xedin
Copy link
Contributor Author

xedin commented Sep 21, 2018

Yeah, I think it might only make sense to really filter out special + no parameters because it would just be initializer 'init'

@xedin
Copy link
Contributor Author

xedin commented Sep 22, 2018

Talked to Jordan offline, and it seems like better option here would be to enable empty label printing for special names, which would make initializer 'init' be printed as initializer 'init(_:)', so I'm going to revert my changes and do it another way...

@xedin xedin reopened this Sep 22, 2018
@xedin xedin merged commit 9ce81df into master Sep 22, 2018
@shahmishal shahmishal deleted the revert-19447-fix-req-diagnstics-not-to-print-special-names branch May 13, 2022 08:51
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.

2 participants