Skip to content

[ConstraintSystem] Detect and fix use of static members in a key path in the solver #24052

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
Apr 16, 2019

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Apr 16, 2019

Previously it was possible to create an invalid solution where
static members would be referenced in a key path, which is not
currently supported and would only be diagnosed while applying
such solution to AST e.g.

struct S {
  static var foo: Int = 42
}

_ = \S.Type.foo

Resolves: rdar://problem/49413561

@xedin
Copy link
Contributor Author

xedin commented Apr 16, 2019

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Apr 16, 2019

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c37fd10e2e101828d59a4c8661d6bc8902995b0c

@xedin
Copy link
Contributor Author

xedin commented Apr 16, 2019

@swift-ci please test macOS platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c37fd10e2e101828d59a4c8661d6bc8902995b0c

xedin added 2 commits April 15, 2019 23:42
… in the solver

Previously it was possible to create an invalid solution where
static members would be referenced in a key path, which is not
currently supported and would only be diagnosed while applying
such solution to AST e.g.

```swift
struct S {
  static var foo: Int = 42
}

_ = \S.Type.foo
```
@xedin
Copy link
Contributor Author

xedin commented Apr 16, 2019

@Catfish-Man Looks like the test you have recently modified is failing a full build - test/SILOptimizer/definite_init_failable_initializers_objc.swift. I see that you have only ran a smoke test in your PR - #23802. Mind taking a look at what is going on?

@xedin xedin force-pushed the static-member-in-keypath-diags branch from c37fd10 to 55bc16e Compare April 16, 2019 06:53
@xedin
Copy link
Contributor Author

xedin commented Apr 16, 2019

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Apr 16, 2019

@swift-ci please test source compatibility

@xedin xedin merged commit b29e8ba into swiftlang:master Apr 16, 2019
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