[GSoC 2023] Key Path inference and diagnostic improvements

Hi everyone!

I will be working on improving key path inference and diagnostics this summer as part of GSoC 2023 with my mentor, @xedin. Perhaps you've encountered key path errors that show type inference failures or do not provide actionable information like the infamous "type of expression is ambiguous without more context". We hope to fix many of these by the end of the summer.

If anyone comes across any other odd key path behavior, feel free to share here!

15 Likes

Does solving this bug Key Path Expressions as Functions and Identity Key Path is on the scope?

1 Like

Hopefully, yes! We expect to change how key path expressions are type checked so that certain type information that currently goes missing during constraint solving and is causing many of these errors is not handled until much later in the type-checking process.

2 Likes

This also may be related to your work

1 Like

Excellent! These are some of the more frustrating errors from the compiler.

1 Like

Not sure if this is in scope, but since I came across it today: Using key path literals as functions defeats @MainActor checks · Issue #63189 · apple/swift · GitHub

2 Likes

This is a pretty cool project, cant wait to follow along the progress!

1 Like