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

[SR-9856] Opaque "Ambiguous reference to member" error #52263

Closed
swift-ci opened this issue Feb 4, 2019 · 4 comments
Closed

[SR-9856] Opaque "Ambiguous reference to member" error #52263

swift-ci opened this issue Feb 4, 2019 · 4 comments

Comments

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Feb 4, 2019

Previous ID SR-9856
Radar rdar://problem/47871590
Original Reporter Jessy (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 10.2 beta

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee Jessy (JIRA)
Priority Medium

md5: b746f15f6230b1e4d1667aeb725fc898

Issue Description:

Sometimes "Ambiguous reference to member" comes up and the compiler isn't helpful enough to allow me to move from concrete type extensions to protocols. Attached is an example. Fixing it might be useful for everyone; it certainly would be to me! (I don't know if the fix is to allow this code to compile, or to just give us better info on why it wouldn't compile.)

@belkadan
Copy link
Contributor

@belkadan belkadan commented Feb 4, 2019

cc @xedin

@xedin
Copy link
Member

@xedin xedin commented Feb 7, 2019

Looks like the problem here is that extension is under-constraint and should have `where Stride: SignedInteger`, I think I can extend existing requirement diagnostics to support this fact and say that reduce could only be used if `Self.Stride` conforms to `SignedInteger`

@xedin
Copy link
Member

@xedin xedin commented Feb 12, 2019

Thank you for the report, Jessy (JIRA User)! #22480 addresses the problem, new diagnostic should be a lot more helpful to fix the problem:

referencing instance method 'reduce' on 'ClosedRange' requires that 'Self.Stride' conform to 'SignedInteger'

@xedin
Copy link
Member

@xedin xedin commented Feb 12, 2019

Please use the next available master snapshot to verify and close.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants