-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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 softwarepack iterationFeature → statements → for-in: Pack iterationFeature → statements → for-in: Pack iterationparameter packsFeature → generics: Parameter packsFeature → generics: Parameter packstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
The following hits an AST verifier assertion:
func foo<each T>(xs: repeat each T) {
_ = {
for x in repeat each xs {
return x
}
}
}
and similarly for:
func eq<T>(_ x: T, _ y: T) {}
func foo<each T>(xs: repeat each T) {
_ = { param in
for x in repeat each xs {
eq(param, x)
}
}
}
Found local archetype 0x1361b0300 outside its defining scope
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 -swift-version 6
1. Swift version 6.2-dev (LLVM 6f7170a253856b8, Swift 95dca81d243d563)
2. Compiling with the current language version
3. While walking into body of 'foo(xs:)' (at /Users/hamish/src/swift-test-arena/main.swift:654:1)
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 0x00000001085f93c4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x00000001085f76e0 llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x00000001085f9a20 SignalHandler(int) + 292
3 libsystem_platform.dylib 0x00000001810b4184 _sigtramp + 56
4 libsystem_pthread.dylib 0x000000018107ef70 pthread_kill + 288
5 libsystem_c.dylib 0x0000000180f8b908 abort + 128
6 swift-frontend 0x0000000103f7de44 (anonymous namespace)::Verifier::verifyChecked(swift::Type) + 428
7 swift-frontend 0x0000000103f77814 swift::ASTWalker::PostWalkResult<swift::NilLiteralExpr*> (anonymous namespace)::Verifier::dispatchVisitPost<swift::NilLiteralExpr*>(swift::NilLiteralExpr*) + 108
8 swift-frontend 0x0000000103f73bd8 (anonymous namespace)::Verifier::walkToExprPost(swift::Expr*) + 972
9 swift-frontend 0x0000000103f83650 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 988
10 swift-frontend 0x0000000103f8480c (anonymous namespace)::Traversal::visitAssignExpr(swift::AssignExpr*) + 36
11 swift-frontend 0x0000000103f834d0 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 604
12 swift-frontend 0x0000000103f8532c swift::Stmt* llvm::function_ref<swift::Stmt* (swift::Stmt*)>::callback_fn<(anonymous namespace)::Traversal::doIt(swift::Stmt*)::'lambda'(swift::Stmt*)>(long, swift::Stmt*) + 372
13 swift-frontend 0x0000000103f85154 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
14 swift-frontend 0x0000000103f87644 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 656
15 swift-frontend 0x0000000103f8644c (anonymous namespace)::Traversal::visit(swift::Decl*) + 140
16 swift-frontend 0x0000000103f83cbc (anonymous namespace)::Traversal::doIt(swift::Decl*) + 284
17 swift-frontend 0x0000000103f83b94 swift::Decl::walk(swift::ASTWalker&) + 32
18 swift-frontend 0x000000010411caf0 swift::SourceFile::walk(swift::ASTWalker&) + 172
19 swift-frontend 0x0000000103f72fc8 swift::verify(swift::SourceFile&) + 80
20 swift-frontend 0x000000010421d904 swift::TypeCheckSourceFileRequest::cacheResult(std::__1::tuple<>) const + 76
21 swift-frontend 0x0000000103d39d10 swift::performTypeChecking(swift::SourceFile&) + 92
22 swift-frontend 0x0000000102d997c4 bool llvm::function_ref<bool (swift::SourceFile&)>::callback_fn<swift::CompilerInstance::performSema()::$_0>(long, swift::SourceFile&) + 16
23 swift-frontend 0x0000000102d92e00 swift::CompilerInstance::forEachFileToTypeCheck(llvm::function_ref<bool (swift::SourceFile&)>) + 164
24 swift-frontend 0x0000000102d92d3c swift::CompilerInstance::performSema() + 76
25 swift-frontend 0x0000000102b559b4 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 60
26 swift-frontend 0x0000000102b4b610 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 700
27 swift-frontend 0x0000000102b4ae6c swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2208
28 swift-frontend 0x0000000102935be4 swift::mainEntry(int, char const**) + 3052
29 dyld 0x0000000180cfc274 start + 2840
fish: Job 1, './swift -frontend -typecheck ~/…' terminated by signal SIGABRT (Abort)
vanvoorden
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 softwarepack iterationFeature → statements → for-in: Pack iterationFeature → statements → for-in: Pack iterationparameter packsFeature → generics: Parameter packsFeature → generics: Parameter packstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis