Skip to content

[QoI] Improve diagnostics when accessing .init on a non-metatype #5869

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 1 commit into from
Nov 23, 2016

Conversation

jtbandes
Copy link
Contributor

@jtbandes jtbandes commented Nov 19, 2016

Resolves SR-3236 by falling through to existing logic when all candidates are inaccessible. Maybe not perfect, but better than the current state of affairs I think.

@jtbandes
Copy link
Contributor Author

@swift-ci please smoke test macOS

@jtbandes jtbandes force-pushed the diag-inaccessible-init branch from a2e6612 to 2fd3aa1 Compare November 19, 2016 09:19
@jtbandes
Copy link
Contributor Author

@swift-ci please smoke test

@jtbandes
Copy link
Contributor Author

cc @xedin @rudkx @jrose-apple who were involved with #5237.

@xedin
Copy link
Contributor

xedin commented Nov 19, 2016

LGTM!

Edit (since I've only read the code and not comments):
I think it's a bit out of context with title, since it checks for acessibility instead of base type, so I think to resolve SR-3236 we need a better diagnostic as @rintaro suggested...

@slavapestov slavapestov merged commit 241abfa into swiftlang:master Nov 23, 2016
@jtbandes jtbandes deleted the diag-inaccessible-init branch November 24, 2016 00:25
@jrose-apple
Copy link
Contributor

I agree with @xedin. This shouldn't be an access control test; we should just reject this member access entirely.

@jrose-apple
Copy link
Contributor

(and the diagnostic shouldn't state anything about "access" or "inaccessible")

@jtbandes
Copy link
Contributor Author

The main point of this PR was to avoid spewing a candidate list when some candidates are actually accessible, but wrong for other, diagnosable reasons (e.g. being a type member while the call site is trying to access an instance member).

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.

5 participants