Skip to content

[CS] Correctly set compound bit for UnresolvedMemberExprs #77944

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 2 commits into from
Dec 4, 2024

Conversation

hamishknight
Copy link
Contributor

Allow IUOs to be used with functions referenced using a compound name, and correctly set the compound bit for UnresolvedMemberExprs.

This is a source breaking change since this used to be legal:

struct S {
  static func foo(x: Int) -> Self { .init() }
}
let _: S = .foo(x:)(x: 0)

However I somewhat doubt anyone is intentionally writing code like that.

This was previously an artificial limitation of the
FunctionRefKind representation, there's no reason
we shouldn't support IUOs for functions referenced
using a compound name.
Now that IUOs are supported for compound function
references, we can properly set the compound bit
here.

This is a source breaking change since this used
to be legal:

```swift
struct S {
  static func foo(x: Int) -> Self { .init() }
}
let _: S = .foo(x:)(x: 0)
```

However I somewhat doubt anyone is intentionally
writing code like that.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@hamishknight hamishknight merged commit 00f6df9 into swiftlang:main Dec 4, 2024
7 checks passed
@hamishknight hamishknight deleted the compound-ume branch December 4, 2024 20:22
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