You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
x86_64-apple-darwin19.6.0
Additional Detail from JIRA
Votes
0
Component/s
Labels
Bug
Assignee
None
Priority
Medium
md5: 508cfdd0b2e6f53e26253db57ca0dc30
Issue Description:
@dynamicMemberLookup subscript in a generic property wrapper fails to infer the correct type when the return type is the same property wrapper type with a different parameter type.
For example:
@dynamicMemberLookupstructT<Foo>{letfoo:Foo
subscript<Bar>(
dynamicMember keyPath:WritableKeyPath<Foo,Bar>)->T<Bar>{T(foo:foo[keyPath: keyPath])// error: Cannot convert return expression of type 'T<Foo>' to return type 'T<Bar>'// error: Cannot convert value of type 'Bar' to expected argument type 'Foo'// fix-it: Insert ' as! Foo'}}
Environment
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
x86_64-apple-darwin19.6.0
Additional Detail from JIRA
md5: 508cfdd0b2e6f53e26253db57ca0dc30
Issue Description:
@dynamicMemberLookup
subscript in a generic property wrapper fails to infer the correct type when the return type is the same property wrapper type with a different parameter type.For example:
relevant topics on the forums:
https://forums.swift.org/t/how-do-i-use-dynamic-member-lookup-in-a-generic-property-wrapper-to-return-the-looked-up-member-wrapped-by-the-same-property-wrapper/43725
https://forums.swift.org/t/using-the-bare-name-of-a-generic-type-within-itself/24778
The text was updated successfully, but these errors were encountered: