Commits

practicalswift committed c7187cb9019
[SIL] Add test case for crash triggered in llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) Stack trace: ``` <stdin>:3:1: error: statement cannot begin with a closure expression {(x:(x:( ^ <stdin>:3:1: note: explicitly discard the result of the closure by assigning to '_' {(x:(x:( ^ _ = <stdin>:3:9: error: expected expression in list of expressions {(x:(x:( ^ <stdin>:3:9: error: expected ',' separator {(x:(x:( ^ , <stdin>:3:9: error: expected ',' separator {(x:(x:( ^ , <stdin>:3:9: error: expected expression in list of expressions {(x:(x:( ^ <stdin>:3:9: error: expected ',' separator {(x:(x:( ^ , <stdin>:3:9: error: expected ',' separator {(x:(x:( ^ , <stdin>:3:9: error: expected expression in list of expressions {(x:(x:( ^ <stdin>:3:9: error: expected ',' separator {(x:(x:( ^ , <stdin>:3:9: error: expected '}' at end of closure {(x:(x:( ^ <stdin>:3:1: note: to match this opening '{' {(x:(x:( ^ <stdin>:3:1: error: expressions are not allowed at the top level {(x:(x:( ^ <stdin>:3:1: error: braced block of statements is an unused closure {(x:(x:( ^ Unhandled coercion UNREACHABLE executed at /path/to/swift/lib/Sema/CSApply.cpp:4913! 6 sil-opt 0x0000000002c115cd llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461 11 sil-opt 0x0000000000ccfdd3 swift::Expr::walk(swift::ASTWalker&) + 19 12 sil-opt 0x0000000000b15286 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502 13 sil-opt 0x0000000000a8730b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683 15 sil-opt 0x0000000000ae8f46 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134 16 sil-opt 0x0000000000a6de0d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581 17 sil-opt 0x0000000000739912 swift::CompilerInstance::performSema() + 2946 18 sil-opt 0x00000000007241dc main + 1916 Stack dump: 0. Program arguments: sil-opt -enable-sil-verify-all 1. While type-checking expression at [<stdin>:3:1 - line:3:8] RangeText="{(x:(x:(" ```