Skip to content

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Nov 12, 2018

Follow-up for SR-9213

@xedin
Copy link
Contributor Author

xedin commented Nov 12, 2018

/cc @theblixguy

@xedin xedin force-pushed the typealias-unsupported-tuple-access-in-keypath branch from aff0dc1 to c1dba16 Compare November 12, 2018 20:57
@xedin
Copy link
Contributor Author

xedin commented Nov 12, 2018

@swift-ci please smoke test

@theblixguy
Copy link
Collaborator

theblixguy commented Nov 12, 2018

Great @xedin! Do you have any idea where I need to start if I want to add support for tuple KeyPaths? I have seen Joe mention it in the Swift forums and how it could be a "starter bug". I've spent a bit of time understanding how KeyPaths are implemented in the compiler, but not totally sure where to begin. Any direction/tips would be greatly appreciated! 😃

@slavapestov
Copy link
Contributor

Does this also fix rdar://37160546 and rdar://34186458?

@xedin
Copy link
Contributor Author

xedin commented Nov 12, 2018

@theblixguy I'm actually not sure what exactly is going on with that... @jckarter could you please clarify a bit (if we don't have an SR for this already)?

@xedin
Copy link
Contributor Author

xedin commented Nov 12, 2018

@slavapestov Unfortunately not, these actually produce solution but then crash trying to apply it.

@theblixguy If you are interested these are the SR for both issues:

Trying to fix these might shed some light on what needs to be done to support tuples in keypath expressions.

@theblixguy
Copy link
Collaborator

Trying to fix these might shed some light on what needs to be done to support tuples in keypath expressions.

Thanks a lot @xedin, I'll take a look :)

@xedin
Copy link
Contributor Author

xedin commented Nov 13, 2018

@swift-ci please smoke test

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Nov 13, 2018

@swift-ci please smoke test

@jckarter
Copy link
Contributor

Trying to fix these might shed some light on what needs to be done to support tuples in keypath expressions.

The main thing missing to support tuples is a representation in AST KeyPathExpr and in SIL's KeyPathPattern for tuple components. The runtime implementation could readily support tuple fields using the same code as for structs.

@xedin xedin merged commit 34bacd1 into swiftlang:master Nov 13, 2018
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.

4 participants