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-11933] Cannot use default arguments with dynamic member lookup #54352

Closed
hamishknight opened this issue Dec 9, 2019 · 2 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Collaborator

Previous ID SR-11933
Radar rdar://problem/57824025
Original Reporter @hamishknight
Type Bug
Status Closed
Resolution Done
Environment

Swift version 5.2-dev (Swift 84e23cc)
Target: x86_64-apple-darwin18.5.0

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

md5: b46c9b9f7dd360351877658626b1d1b2

Issue Description:

The following doesn't compile:

struct R {
  subscript(_ x: Int = 0) -> Int { x }
}

@dynamicMemberLookup
struct S {
  subscript(dynamicMember kp: KeyPath<R, Int>) -> Int { 0 }
}

func foo(_ x: S) {
  _ = x[] // error: missing argument for parameter #&#8203;1 in call [missing_argument_positional]
}

But really should.

@beccadax
Copy link
Contributor

@swift-ci create

@hamishknight
Copy link
Collaborator Author

Fixed by #28807

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants