[SR-12723] Type compatibility check around @convention is not enough #55167
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
Environment
Toolchain: swift-DEVELOPMENT-SNAPSHOT-2020-05-01-a
OS: macOS 10.15.4
Additional Detail from JIRA
md5: 970563cc96d0310cc02b3f2bb9f680b2
Issue Description:
The type checker says that `(@convention(c) () -> Void) -> Void` is compatible with `(() -> Void) -> Void` but actually not.
In this example, the wrong compatibility check allows capturing `a` in the closure called by C convention.
Output:
The text was updated successfully, but these errors were encountered: