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-14060] Diagnostics not produced for function match with ambiguous conventions #56449

Open
LucianoPAlmeida opened this issue Jan 16, 2021 · 4 comments
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis

Comments

@LucianoPAlmeida
Copy link
Collaborator

Previous ID SR-14060
Radar rdar://problem/74111727
Original Reporter @LucianoPAlmeida
Type Sub-task

Attachment: Download

Environment

XCode 12.3 (12C33), also in main

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Sub-task, DiagnosticsQoI, TypeChecker
Assignee None
Priority Medium

md5: 54f129e2b2676c9b2bedab2e693af9e2

Parent-Task:

  • SR-14169 ☂️ Compiler/runtime issues while converting functions with incompatible representations

Issue Description:

This code is currently producing a ambiguous diagnostic.

func cf2<K>(_ f: (K) -> Void) {}
func cf1<K>(_ f: @convention(thin) (K) -> Void) {}

func a() -> @convention(thin) (Int) -> Int { fatalError() }
func a() -> @convention(c) (Int) -> Int { fatalError() }
func a() -> @convention(swift) (Int) -> Int { fatalError() }

cf2(a()) // type of expression is ambiguous without more context
cf1(a()) // type of expression is ambiguous without more context

@LucianoPAlmeida
Copy link
Collaborator Author

This could (I didn't investigated yet) be related to SR-13776

@typesanitizer
Copy link

Could you clarify what is wrong with the diagnostic here/what it should be instead?

@LucianoPAlmeida
Copy link
Collaborator Author

I would expect something like `ambiguous call to function 'a'` and a `found candidate note` on each viable declaration.
What I meant about being related to the other SR is the handle on `diagnoseAmbiguityWithFixes` but I didn't investigate it yet

@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants