Open swift-ci opened 7 years ago
Fails on macOS too (as expected, no reason for this to be platform-specific).
It looks like the type-checker is incorrectly marking the call as producing a Void?
result instead of Void
and then wrapping it in an Optional.
(optional_evaluation_expr implicit type='()?' location=<stdin>:2:9 range=[<stdin>:2:3 - line:7:3]
(call_expr type='()?' location=<stdin>:2:9 range=[<stdin>:2:3 - line:7:3] nothrow arg_labels=to:capacity:_:
(dot_syntax_call_expr type='(UInt8.Type, Int, (UnsafePointer<UInt8>) throws -> ()?) throws -> ()?' location=<stdin>:2:9 range=[<stdin>:2:3 - line:2:9] nothrow
Over to Mark.
Environment
Target: s390x-ibm-linux Swift version 3.0-dev checked out at 2016-10-12 (LLVM 2cb28b32ee, Clang 5d885a53fc, Swift 785b4ebf48)Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, CompilerCrash, TypeChecker | |Assignee | @slavapestov | |Priority | Medium | md5: 55d6cc0cbd36882675eb06eb26c8026arelates to:
Issue Description:
Assertion failed in Swift compiler for the following program:
But if we unwrap data before calling withMemoryRebound(), the assertion error is gone: