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-6740] KeyPath: should infer class from argument types #49289

Closed
swift-ci opened this issue Jan 12, 2018 · 1 comment
Closed

[SR-6740] KeyPath: should infer class from argument types #49289

swift-ci opened this issue Jan 12, 2018 · 1 comment
Labels
compiler The Swift compiler in itself improvement type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-6740
Radar rdar://problem/36472188
Original Reporter hexdreamer (JIRA User)
Type Improvement
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Improvement, TypeChecker
Assignee None
Priority Medium

md5: caccd4d84645c726c49d703df75edec6

duplicates:

  • SR-5667 Type inference for Swift 4 KeyPaths fails within collections

Issue Description:

From https://lists.swift.org/pipermail/swift-users/Week-of-Mon-20180108/006876.html

This code does not compile, although you would expect that the compiler has everything it needs to infer the class for the keypath.

class ThePath {
    var isWinding:Bool?
}

func walk<T>(aPath:T, forKey:PartialKeyPath<T>) {}

func walkThePath(aPath:ThePath, forKey:PartialKeyPath<ThePath>) {}

func test() {
    let path = ThePath()
    walkThePath(aPath:path, forKey:\.isWinding)
    walk(aPath:path, forKey:\.isWinding)
}
@belkadan
Copy link
Contributor

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself improvement type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants