Skip to content

[Diagnostics] Support diagnosing references to operators without argument application #30655

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
Mar 26, 2020

Conversation

hborla
Copy link
Member

@hborla hborla commented Mar 26, 2020

in MissingConformanceFailure::diagnoseAsAmbiguousOperatorRef

When there's an ambiguous operator reference that manifests as a missing conformance failure, such as:

func myAssertion<T>(_ a: T, _ op: ((T,T)->Bool), _ b: T) {}
var e: Error? = nil
myAssertion(e, ==, nil)

This previously would crash because the code assumed the parent of the operator ref was an ApplyExpr.

This will also print a note pointing to the candidate with the conformance requirement.

Resolves: rdar://problem/60727310

…ment

application in MissingConformanceFailure::diagnoseAsAmbiguousOperatorRef
@hborla hborla requested a review from xedin March 26, 2020 16:15
@hborla
Copy link
Member Author

hborla commented Mar 26, 2020

@swift-ci please smoke test

@hborla hborla merged commit febcbf6 into swiftlang:master Mar 26, 2020
@hborla hborla deleted the missing-conformance-operator-ref branch March 26, 2020 18:13
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