Skip to content
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

[SR-6742] IUO Key Path values don't become Optional values #49291

Open
stephencelis opened this issue Jan 12, 2018 · 1 comment
Open

[SR-6742] IUO Key Path values don't become Optional values #49291

stephencelis opened this issue Jan 12, 2018 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself key paths Feature: key paths (both native and Objective-C) type checker Area → compiler: Semantic analysis

Comments

@stephencelis
Copy link
Contributor

Previous ID SR-6742
Radar None
Original Reporter @stephencelis
Type Bug
Environment

Swift 4.0

Swift 4.1 (2017-12-30 snapshot)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, KeyPaths, TypeChecker
Assignee None
Priority Medium

md5: fd6833b76a35a6f459f44fe77067ead5

Issue Description:

The following snippet fails to compile:

struct Root {
  let value: String!
}

func a<R>(_ keyPath: KeyPath<R, String?>) -> (String) -> (R) -> R {
  return { _ in
    fatalError()
  }
}

a(\Root.value)

Cannot convert value of type 'KeyPath<Root, String!>' to expected argument type 'KeyPath<_, String?>'

Per a Twitter convo, this is a bug!

@belkadan
Copy link
Contributor

cc @rudkx, @jckarter

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself key paths Feature: key paths (both native and Objective-C) type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants