-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
compilerThe Swift compiler itselfThe Swift compiler itself
Description
| Previous ID | SR-14160 |
| Radar | rdar://problem/74110413 |
| Original Reporter | @LucianoPAlmeida |
| Type | Sub-task |
Attachment: Download
Environment
Xcode 12.3 (12C33)
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Sub-task |
| Assignee | None |
| Priority | Medium |
md5: d343b7970380688af4185c9df548b637
Parent-Task:
- SR-14169 ☂️ Compiler/runtime issues while converting functions with incompatible representations
relates to:
- SR-14058 Trying to coerce regular function to @convention(c) traps
Issue Description:
Both compiles fine, but crashes at runtime because of thick-to-thin conversion
Note: Removing @convention(thin) this executes fine
I think the compiler should emit a conversion mismatch diagnostic.
func a<K: Hashable, V>(d: [K: V], p: @convention(thin) (K, V) -> Void) {
//_ = d.lazy.map(p) // Runtime crash
p(d.first!.key, d.first!.value) // Also runtime crash.
}
let v = [1: "1"]
a(d: v, p: { _,_ in })

Metadata
Metadata
Assignees
Labels
compilerThe Swift compiler itselfThe Swift compiler itself