Calling rethrows from rethrows crashes Swift compiler
| Originator: | robnapier | ||
| Number: | rdar://21432429 | Date Originated: | 17-Jun-2015 07:50 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Swift 2b1 |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Always |
The following code will crash the Swift compiler:
func x(f: () throws ->()) rethrows {}
func y(f: () throws ->()) rethrows { x(f) }
Assertion failed: (getResult() == ThrowingKind::Throws), function getThrowsReason, file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-700.0.38.1/src/swift/lib/Sema/TypeCheckError.cpp, line 343.
0 swift 0x00000001081fbe0b llvm::sys::PrintStackTrace(__sFILE*) + 43
1 swift 0x00000001081fc54b SignalHandler(int) + 379
2 libsystem_platform.dylib 0x00007fff92159f1a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fff599f0f40 _sigtramp + 3347673152
4 libsystem_c.dylib 0x00007fff943c0b53 abort + 129
5 libsystem_c.dylib 0x00007fff94388c39 basename + 0
6 swift 0x000000010687baf6 (anonymous namespace)::CheckErrorCoverage::checkThrowSite(swift::ASTNode, bool, (anonymous namespace)::Classification const&) + 774
7 swift 0x000000010687aa68 (anonymous namespace)::ErrorHandlingWalker<(anonymous namespace)::CheckErrorCoverage>::walkToExprPre(swift::Expr*) + 360
8 swift 0x00000001069326bc swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 364
9 swift 0x000000010692fb57 swift::Stmt::walk(swift::ASTWalker&) + 87
10 swift 0x000000010687a653 swift::TypeChecker::checkFunctionErrorHandling(swift::AbstractFunctionDecl*) + 403
11 swift 0x0000000106859efb typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) + 1451
12 swift 0x000000010685a73c swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1772
13 swift 0x000000010666d565 swift::CompilerInstance::performSema() + 4133
14 swift 0x00000001062135b0 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 736
15 swift 0x00000001062130b3 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2515
16 swift 0x000000010620f28f main + 1983
17 libdyld.dylib 0x00007fff92d8f5c9 start + 1
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!