-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarepattern matchingFeature: pattern matchingFeature: pattern matchingpatternsFeature: patternsFeature: patternstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
This hits an AST verification error, and crashes in SILGen if you disable the verifier:
enum E {
case e
static func foo() {
_ = { [self] in
switch e {
case e:
break
default:
break
}
}
}
}
VarDecl is missing a Generic Environment: <<error type>>
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /Users/hamish/src/swift-dev/build/Release/swift-macosx-arm64/bin/swift-frontend -typecheck /Users/hamish/src/swift-test-arena/main.swift -sdk /Users/hamish/src/MacOSX.sdk -debug-diagnostic-names -diagnostic-style=llvm
1. Swift version 6.2-dev (LLVM b50d46753102412, Swift 5674b6e047b7b96)
2. Compiling with effective version 5.10
3. While walking into 'E' (at /Users/hamish/src/swift-test-arena/main.swift:930:1)
4. While walking into body of 'foo()' (at /Users/hamish/src/swift-test-arena/main.swift:933:3)
5. While verifying VarDecl 'self' (at /Users/hamish/src/swift-test-arena/main.swift:934:12)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 swift-frontend 0x000000010a6fbed4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x000000010a6fa1f0 llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x000000010a6fc550 SignalHandler(int, __siginfo*, void*) + 324
3 libsystem_platform.dylib 0x000000018677b624 _sigtramp + 56
4 libsystem_pthread.dylib 0x000000018674188c pthread_kill + 296
5 libsystem_c.dylib 0x000000018664ac60 abort + 124
6 swift-frontend 0x000000010a778618 (anonymous namespace)::Verifier::verifyChecked(swift::AbstractStorageDecl*) (.cold.2) + 0
7 swift-frontend 0x000000010600b5b0 (anonymous namespace)::Verifier::verifyChecked(swift::VarDecl*) + 736
8 swift-frontend 0x0000000105fff0b0 (anonymous namespace)::Verifier::walkToDeclPost(swift::Decl*) + 2660
9 swift-frontend 0x000000010600cdcc (anonymous namespace)::Traversal::doIt(swift::Decl*) + 308
10 swift-frontend 0x000000010600ebdc swift::Pattern* llvm::function_ref<swift::Pattern* (swift::Pattern*)>::callback_fn<(anonymous namespace)::Traversal::doIt(swift::Pattern*)::'lambda'(swift::Pattern*)>(long, swift::Pattern*) + 376
11 swift-frontend 0x000000010600e178 swift::Pattern* (anonymous namespace)::Traversal::traverse<swift::Pattern>(swift::ASTWalker::PreWalkResult<swift::Pattern*>, llvm::function_ref<swift::Pattern* (swift::Pattern*)>, llvm::function_ref<swift::ASTWalker::PostWalkResult<swift::Pattern*> (swift::Pattern*)>) + 84
12 swift-frontend 0x000000010600fd0c (anonymous namespace)::Traversal::visit(swift::Decl*) + 2436
13 swift-frontend 0x000000010600cdb4 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 284
14 swift-frontend 0x000000010600d300 (anonymous namespace)::Traversal::visitCaptureListExpr(swift::CaptureListExpr*) + 56
15 swift-frontend 0x000000010600c4e0 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 372
16 swift-frontend 0x000000010600d8e4 (anonymous namespace)::Traversal::visitAssignExpr(swift::AssignExpr*) + 60
17 swift-frontend 0x000000010600c5c8 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 604
18 swift-frontend 0x000000010600e350 swift::Stmt* llvm::function_ref<swift::Stmt* (swift::Stmt*)>::callback_fn<(anonymous namespace)::Traversal::doIt(swift::Stmt*)::'lambda'(swift::Stmt*)>(long, swift::Stmt*) + 372
19 swift-frontend 0x000000010600e178 swift::Pattern* (anonymous namespace)::Traversal::traverse<swift::Pattern>(swift::ASTWalker::PreWalkResult<swift::Pattern*>, llvm::function_ref<swift::Pattern* (swift::Pattern*)>, llvm::function_ref<swift::ASTWalker::PostWalkResult<swift::Pattern*> (swift::Pattern*)>) + 84
20 swift-frontend 0x00000001060106b0 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 656
21 swift-frontend 0x000000010600f414 (anonymous namespace)::Traversal::visit(swift::Decl*) + 140
22 swift-frontend 0x000000010600cdb4 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 284
23 swift-frontend 0x00000001060102c8 (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 460
24 swift-frontend 0x000000010600f404 (anonymous namespace)::Traversal::visit(swift::Decl*) + 124
25 swift-frontend 0x000000010600cdb4 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 284
26 swift-frontend 0x000000010600cc8c swift::Decl::walk(swift::ASTWalker&) + 32
27 swift-frontend 0x00000001061b6b88 swift::SourceFile::walk(swift::ASTWalker&) + 172
28 swift-frontend 0x0000000105ffc0ac swift::verify(swift::SourceFile&) + 80
29 swift-frontend 0x00000001062be93c swift::TypeCheckPrimaryFileRequest::cacheResult(std::__1::tuple<>) const + 76
30 swift-frontend 0x0000000105d94e48 swift::performTypeChecking(swift::SourceFile&) + 92
31 swift-frontend 0x0000000104dc85f8 bool llvm::function_ref<bool (swift::SourceFile&)>::callback_fn<swift::CompilerInstance::performSema()::$_0>(long, swift::SourceFile&) + 16
32 swift-frontend 0x0000000104dbf9c8 swift::CompilerInstance::forEachFileToTypeCheck(llvm::function_ref<bool (swift::SourceFile&)>) + 164
33 swift-frontend 0x0000000104dbf904 swift::CompilerInstance::performSema() + 76
34 swift-frontend 0x0000000104b82274 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 60
35 swift-frontend 0x0000000104b77c68 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 700
36 swift-frontend 0x0000000104b7745c swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2252
37 swift-frontend 0x0000000104959878 swift::mainEntry(int, char const**) + 3112
38 dyld 0x00000001863a2b4c start + 6000
fish: Job 1, './swift -frontend -typecheck ~/…' terminated by signal SIGABRT (Abort)
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwarepattern matchingFeature: pattern matchingFeature: pattern matchingpatternsFeature: patternsFeature: patternstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis