-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
@dynamicMemberLookupFeature → attributes: the @dynamicMemberLookup attributeFeature → attributes: the @dynamicMemberLookup attributeattributesFeature: Declaration and type attributesFeature: Declaration and type attributescompilerThe Swift compiler itselfThe Swift compiler itselfdefault argumentsFeature: default arguments for value parametersFeature: default arguments for value parametersfeatureA feature request or implementationA feature request or implementation
Description
Is your feature request related to a problem? Please describe.
Dynamic member lookup subscript should support file:line: default parameters. Knowing the calling context of the lookup can be important for surfacing where the source origin of a problem is.
Describe the solution you'd like
The following code should compile:
@dynamicMemberLookup
struct S<T> {
var wrappedValue: T
subscript<U>(
dynamicMember keyPath: KeyPath<T, U>
// Comment the next line out and all is well.
, file: StaticString = #file, line: UInt = #line
) -> U {
self.wrappedValue[keyPath: keyPath]
}
}Metadata
Metadata
Assignees
Labels
@dynamicMemberLookupFeature → attributes: the @dynamicMemberLookup attributeFeature → attributes: the @dynamicMemberLookup attributeattributesFeature: Declaration and type attributesFeature: Declaration and type attributescompilerThe Swift compiler itselfThe Swift compiler itselfdefault argumentsFeature: default arguments for value parametersFeature: default arguments for value parametersfeatureA feature request or implementationA feature request or implementation