-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselftype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Previous ID | SR-6603 |
Radar | rdar://problem/36054961 |
Original Reporter | @Frizlab |
Type | Bug |
Status | Resolved |
Resolution | Done |
Environment
Xcode 9.2 (9C40b)
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, TypeChecker |
Assignee | @xedin |
Priority | Medium |
md5: f71dbb5c51fe5652f94c69e6b7e9a619
Issue Description:
The following code, which IMHO have a valid syntax, does not compile with the compiler error “‘inout String’ is not convertible to ‘String’”:
func take(closureDictionary: [String: (inout String, Range<String.Index>, String) -> Void]) {
}
take(closureDictionary: ["abc": { str, range, _ in
{{ str.replaceSubrange(range, with: str[range].reversed())}}
}])
Funnily enough, this one does:
func take(closureDictionary: [String: (inout String, Range<String.Index>, String) -> Void]) {
{{}}}
take(closureDictionary: ["abc": { str, range, _ in
{{ ()}}
{{ str.replaceSubrange(range, with: str[range].reversed())}}
}])
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselftype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis