swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.49k stars 10.35k forks source link

Assert ((M->isGlobalModule() || Loc.isValid()) && "setVisible expects a valid import location") building CxxSpanTests.swift #76194

Closed rjmansfield closed 1 week ago

rjmansfield commented 1 month ago

Description

Building CxxSpanTests.swift triggers Assertion failed: ((M->isGlobalModule() || Loc.isValid()) && "setVisible expects a valid import location"), function setVisible, file Module.cpp, line 666.

Reproduction


[2337/2614][ 89%][536.889s] Generating O-arm64-apple-macosx10.13/CxxSpanTests.o
FAILED: benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.o /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.o 
cd /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark && /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin/swiftc -c -target arm64-apple-macosx10.13 -module-cache-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/modulecache -O -Xllvm -align-module-to-page-size -g -I /Users/ryan_mansfield/swift/swift/benchmark/utils/ObjectiveCTests -I /Users/ryan_mansfield/swift/swift/benchmark/utils/LibProc -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/../../../Developer/Library/Frameworks -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -no-link-objc-runtime -save-optimization-record=bitstream -swift-version 4 -parse-as-library -whole-module-optimization -module-name CxxSpanTests -emit-module-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.swiftmodule -I /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13 -Xfrontend -enable-experimental-cxx-interop -I /Users/ryan_mansfield/swift/swift/benchmark/utils/CxxTests/ -Xcc -std=c++20 -Xfrontend -validate-tbd-against-ir=none -o /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.o /Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift
<unknown>:0: warning: the '-enable-experimental-cxx-interop' flag is deprecated; please pass '-cxx-interoperability-mode=' instead
<unknown>:0: note: Swift will maintain source compatibility for imported APIs based on the selected compatibility mode, so updating the Swift compiler will not change how APIs are imported
<unknown>:0: error: partial specialization of 'span<_Tp, dynamic_extent>' must be imported from module 'std_span' before it is required
Assertion failed: ((M->isGlobalModule() || Loc.isValid()) && "setVisible expects a valid import location"), function setVisible, file Module.cpp, line 666.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.  Program arguments: /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin/swift-frontend -frontend -c /Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift -save-optimization-record=bitstream -emit-module-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.swiftmodule -emit-module-doc-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.swiftdoc -emit-module-source-info-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.swiftsourceinfo -save-optimization-record-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.opt.bitstream -emit-abi-descriptor-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.abi.json -target arm64-apple-macosx10.13 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -I /Users/ryan_mansfield/swift/swift/benchmark/utils/ObjectiveCTests -I /Users/ryan_mansfield/swift/swift/benchmark/utils/LibProc -I /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13 -I /Users/ryan_mansfield/swift/swift/benchmark/utils/CxxTests -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/modulecache -swift-version 4 -O -enable-experimental-cxx-interop -validate-tbd-against-ir=none -empty-abi-descriptor -Xcc -working-directory -Xcc /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark -resource-dir /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/swift -file-compilation-dir /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark -Xllvm -align-module-to-page-size -Xcc -std=c++20 -module-name CxxSpanTests -in-process-plugin-server-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/swift/host/plugins -plugin-path /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/local/lib/swift/host/plugins -target-sdk-version 14.4 -target-sdk-name macosx14.4 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -enable-default-cmo -parse-as-library -o /Users/ryan_mansfield/swift/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/benchmark/O-arm64-apple-macosx10.13/CxxSpanTests.o
1.  Swift version 6.1-dev (LLVM fe0f467028c23cf, Swift 614e8aa79a84486)
2.  Compiling with effective version 4.1.50
3.  While evaluating request TypeCheckSourceFileRequest(source_file "/Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift")
4.  While evaluating request TypeCheckFunctionBodyRequest(CxxSpanTests.(file).run_CxxSpanOfU32_RawIterator@/Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift:61:13)
5.  While type-checking statement at [/Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift:61:52 - line:72:1] RangeText="{
  var sum: UInt32 = 0
  for _ in 0..<(n * iterRepeatFactor * 2) {
    var b = span.__beginUnsafe()
    let e = span.__endUnsafe()
    while b != e {
      sum = sum &+ b.pointee
      b = b.successor()
    }
  }
  blackHole(sum)
"
6.  While type-checking statement at [/Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift:63:3 - line:70:3] RangeText="for _ in 0..<(n * iterRepeatFactor * 2) {
    var b = span.__beginUnsafe()
    let e = span.__endUnsafe()
    while b != e {
      sum = sum &+ b.pointee
      b = b.successor()
    }
  "
7.  While type-checking statement at [/Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift:63:43 - line:70:3] RangeText="{
    var b = span.__beginUnsafe()
    let e = span.__endUnsafe()
    while b != e {
      sum = sum &+ b.pointee
      b = b.successor()
    }
  "
8.  While type-checking declaration 0x14d1e4d68 (at /Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift:64:5)
9.  While evaluating request PatternBindingEntryRequest((unknown decl)@/Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift:64:5, 0)
10. While type-checking expression at [/Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift:64:13 - line:64:32] RangeText="span.__beginUnsafe("
11. While type-checking-target starting at /Users/ryan_mansfield/swift/swift/benchmark/cxx-source/CxxSpanTests.swift:64:18
12. While evaluating request InterfaceTypeRequest(CxxStdlibPerformance.(file).span)
13. While importing a clang type ElaboratedType 0x14e772e00 'SpanOfU32' sugar imported
`-TypedefType 0x14e7895d0 'SpanOfU32' sugar imported
  |-TypeAlias 0x14f808bc0 'SpanOfU32'
  `-ElaboratedType 0x14e789550 'std::span<uint32_t>' sugar imported
    `-TemplateSpecializationType 0x14e789510 'span<uint32_t>' sugar imported span
      |-TemplateArgument type 'uint32_t':'unsigned int'
      | `-ElaboratedType 0x14e770dc0 'uint32_t' sugar imported
      |   `-TypedefType 0x14e770d90 'uint32_t' sugar imported
      |     |-Typedef 0x14e770d20 'uint32_t'
      |     `-BuiltinType 0x14d0391b0 'unsigned int'
      `-RecordType 0x14e7894f0 'std::span<unsigned int>' imported
        `-ClassTemplateSpecialization 0x14e746408 'span'
14. While importing a clang type TypedefType 0x14e7895d0 'SpanOfU32' sugar imported
|-TypeAlias 0x14f808bc0 'SpanOfU32'
`-ElaboratedType 0x14e789550 'std::span<uint32_t>' sugar imported
  `-TemplateSpecializationType 0x14e789510 'span<uint32_t>' sugar imported span
    |-TemplateArgument type 'uint32_t':'unsigned int'
    | `-ElaboratedType 0x14e770dc0 'uint32_t' sugar imported
    |   `-TypedefType 0x14e770d90 'uint32_t' sugar imported
    |     |-Typedef 0x14e770d20 'uint32_t'
    |     `-BuiltinType 0x14d0391b0 'unsigned int'
    `-RecordType 0x14e7894f0 'std::span<unsigned int>' imported
      `-ClassTemplateSpecialization 0x14e746408 'span'
15. /Users/ryan_mansfield/swift/swift/benchmark/utils/CxxTests/CxxStdlibPerformance.h:18:7: importing 'SpanOfU32'
16. While importing a clang type ElaboratedType 0x14e789550 'std::span<uint32_t>' sugar imported
`-TemplateSpecializationType 0x14e789510 'span<uint32_t>' sugar imported span
  |-TemplateArgument type 'uint32_t':'unsigned int'
  | `-ElaboratedType 0x14e770dc0 'uint32_t' sugar imported
  |   `-TypedefType 0x14e770d90 'uint32_t' sugar imported
  |     |-Typedef 0x14e770d20 'uint32_t'
  |     `-BuiltinType 0x14d0391b0 'unsigned int'
  `-RecordType 0x14e7894f0 'std::span<unsigned int>' imported
    `-ClassTemplateSpecialization 0x14e746408 'span'
17. While importing a clang type TemplateSpecializationType 0x14e789510 'span<uint32_t>' sugar imported span
|-TemplateArgument type 'uint32_t':'unsigned int'
| `-ElaboratedType 0x14e770dc0 'uint32_t' sugar imported
|   `-TypedefType 0x14e770d90 'uint32_t' sugar imported
|     |-Typedef 0x14e770d20 'uint32_t'
|     `-BuiltinType 0x14d0391b0 'unsigned int'
`-RecordType 0x14e7894f0 'std::span<unsigned int>' imported
  `-ClassTemplateSpecialization 0x14e746408 'span'
18. While importing a clang type RecordType 0x14e7894f0 'std::span<unsigned int>' imported
`-ClassTemplateSpecialization 0x14e746408 'span'
19. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/span:391:28: importing 'std::span'
20. While conforming to CxxSpan 'span<CUnsignedInt, _CUnsignedLong_-1>' (in module '__ObjC')

Stack dump

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           0x000000010807673c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000108074e90 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000108076da0 SignalHandler(int) + 332
3  libsystem_platform.dylib 0x0000000186328b64 _sigtramp + 56
4  libsystem_pthread.dylib  0x00000001862f3f50 pthread_kill + 288
5  libsystem_c.dylib        0x0000000186200908 abort + 128
6  libsystem_c.dylib        0x00000001861ffc1c err + 0
7  swift-frontend           0x00000001093bf09c clang::ASTSourceDescriptor::ASTSourceDescriptor(clang::Module&) (.cold.1) + 0
8  swift-frontend           0x0000000107f30118 clang::VisibleModuleSet::makeTransitiveImportsVisible(clang::Module*, clang::SourceLocation, llvm::function_ref<void (clang::Module*)>, llvm::function_ref<void (llvm::ArrayRef<clang::Module*>, clang::Module*, llvm::StringRef)>) + 0
9  swift-frontend           0x0000000106baeaa4 clang::Sema::createImplicitModuleImportForErrorRecovery(clang::SourceLocation, clang::Module*) + 268
10 swift-frontend           0x0000000106ba0a40 clang::Sema::diagnoseMissingImport(clang::SourceLocation, clang::NamedDecl const*, clang::SourceLocation, llvm::ArrayRef<clang::Module*>, clang::Sema::MissingImportKind, bool) + 1356
11 swift-frontend           0x0000000106ba0164 clang::Sema::diagnoseMissingImport(clang::SourceLocation, clang::NamedDecl const*, clang::Sema::MissingImportKind, bool) + 472
12 swift-frontend           0x0000000106cf87ec (anonymous namespace)::ExplicitSpecializationVisibilityChecker::check(clang::NamedDecl*) + 1496
13 swift-frontend           0x0000000106ce7e3c clang::Sema::checkSpecializationReachability(clang::SourceLocation, clang::NamedDecl*) + 124
14 swift-frontend           0x0000000106e8fc50 clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser*) + 592
15 swift-frontend           0x0000000106e8f908 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::CompleteTypeKind, clang::Sema::TypeDiagnoser&) + 32
16 swift-frontend           0x0000000106ac1cbc clang::Sema::BuildCXXTypeConstructExpr(clang::TypeSourceInfo*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, bool) + 1076
17 swift-frontend           0x000000010403e7dc swift::conformToCxxSpanIfNeeded(swift::ClangImporter::Implementation&, swift::NominalTypeDecl*, clang::CXXRecordDecl const*) + 844
18 swift-frontend           0x00000001040c431c (anonymous namespace)::SwiftDeclConverter::VisitCXXRecordDecl(clang::CXXRecordDecl const*) + 3400
19 swift-frontend           0x00000001040aeb1c swift::ClangImporter::Implementation::importDeclImpl(clang::NamedDecl const*, swift::importer::ImportNameVersion, bool&, bool&) + 1004
20 swift-frontend           0x00000001040af88c swift::ClangImporter::Implementation::importDeclAndCacheImpl(clang::NamedDecl const*, swift::importer::ImportNameVersion, bool, bool) + 484
21 swift-frontend           0x00000001040ee6d0 (anonymous namespace)::SwiftTypeConverter::VisitRecordType(clang::RecordType const*) + 64
22 swift-frontend           0x00000001040e5eb8 (anonymous namespace)::SwiftTypeConverter::Visit(clang::QualType) + 120
23 swift-frontend           0x00000001040e5eb8 (anonymous namespace)::SwiftTypeConverter::Visit(clang::QualType) + 120
24 swift-frontend           0x00000001040e5754 swift::ClangImporter::Implementation::importType(clang::QualType, swift::ImportTypeKind, llvm::function_ref<void (swift::Diagnostic&&)>, bool, swift::Bridgeability, swift::optionset::OptionSet<swift::ImportTypeAttr, unsigned char>, swift::OptionalTypeKind, bool, std::__1::optional<unsigned int>) + 832
25 swift-frontend           0x00000001040e5f08 swift::ClangImporter::Implementation::importTypeIgnoreIUO(clang::QualType, swift::ImportTypeKind, llvm::function_ref<void (swift::Diagnostic&&)>, bool, swift::Bridgeability, swift::optionset::OptionSet<swift::ImportTypeAttr, unsigned char>, swift::OptionalTypeKind, bool) + 40
26 swift-frontend           0x00000001040d1f10 (anonymous namespace)::SwiftDeclConverter::VisitTypedefNameDecl(clang::TypedefNameDecl const*) + 7504
27 swift-frontend           0x00000001040aea5c swift::ClangImporter::Implementation::importDeclImpl(clang::NamedDecl const*, swift::importer::ImportNameVersion, bool&, bool&) + 812
28 swift-frontend           0x00000001040af88c swift::ClangImporter::Implementation::importDeclAndCacheImpl(clang::NamedDecl const*, swift::importer::ImportNameVersion, bool, bool) + 484
29 swift-frontend           0x00000001040ee8e4 (anonymous namespace)::SwiftTypeConverter::VisitTypedefType(clang::TypedefType const*) + 140
30 swift-frontend           0x00000001040e5eb8 (anonymous namespace)::SwiftTypeConverter::Visit(clang::QualType) + 120
31 swift-frontend           0x00000001040e5754 swift::ClangImporter::Implementation::importType(clang::QualType, swift::ImportTypeKind, llvm::function_ref<void (swift::Diagnostic&&)>, bool, swift::Bridgeability, swift::optionset::OptionSet<swift::ImportTypeAttr, unsigned char>, swift::OptionalTypeKind, bool, std::__1::optional<unsigned int>) + 832
32 swift-frontend           0x00000001040593ac swift::ClangImporter::importVarDeclType(clang::VarDecl const*, swift::VarDecl*, swift::DeclContext*) + 392
33 swift-frontend           0x0000000103f29964 swift::InterfaceTypeRequest::evaluate(swift::Evaluator&, swift::ValueDecl*) const + 3208
34 swift-frontend           0x00000001042e4904 swift::ValueDecl::getInterfaceType() const + 312
35 swift-frontend           0x00000001042fcfdc swift::VarDecl::getTypeInContext() const + 64
36 swift-frontend           0x0000000103e23084 swift::constraints::ConstraintSystem::getVarType(swift::VarDecl const*) + 32
37 swift-frontend           0x0000000103d27350 (anonymous namespace)::ConstraintGenerator::visitDeclRefExpr(swift::DeclRefExpr*) + 152
38 swift-frontend           0x0000000103d2366c (anonymous namespace)::ConstraintWalker::walkToExprPost(swift::Expr*) + 656
39 swift-frontend           0x000000010428b724 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 232
40 swift-frontend           0x000000010428b6f4 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 184
41 swift-frontend           0x000000010428d5e4 (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 40
42 swift-frontend           0x000000010428b77c (anonymous namespace)::Traversal::doIt(swift::Expr*) + 320
43 swift-frontend           0x000000010428b630 swift::Expr::walk(swift::ASTWalker&) + 32
44 swift-frontend           0x0000000103d1f34c swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*, swift::DeclContext*) + 104
45 swift-frontend           0x0000000103d1e658 swift::constraints::ConstraintSystem::generateConstraints(swift::constraints::SyntacticElementTarget&, swift::FreeTypeVariableBinding) + 432
46 swift-frontend           0x0000000103d83524 swift::constraints::ConstraintSystem::solveImpl(swift::constraints::SyntacticElementTarget&, swift::FreeTypeVariableBinding) + 392
47 swift-frontend           0x0000000103d82df0 swift::constraints::ConstraintSystem::solve(swift::constraints::SyntacticElementTarget&, swift::FreeTypeVariableBinding) + 148
48 swift-frontend           0x0000000103f17958 swift::TypeChecker::typeCheckTarget(swift::constraints::SyntacticElementTarget&, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 292
49 swift-frontend           0x0000000103f177dc swift::TypeChecker::typeCheckExpression(swift::constraints::SyntacticElementTarget&, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 184
50 swift-frontend           0x0000000103f188b4 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 120
51 swift-frontend           0x0000000103f18ad8 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int, swift::Type, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 232
52 swift-frontend           0x0000000103ff5424 swift::PatternBindingEntryRequest::evaluate(swift::Evaluator&, swift::PatternBindingDecl*, unsigned int) const + 1816
53 swift-frontend           0x000000010431d0c4 swift::PatternBindingEntryRequest::OutputType swift::Evaluator::getResultUncached<swift::PatternBindingEntryRequest, swift::PatternBindingEntryRequest::OutputType swift::evaluateOrDefault<swift::PatternBindingEntryRequest>(swift::Evaluator&, swift::PatternBindingEntryRequest, swift::PatternBindingEntryRequest::OutputType)::'lambda'()>(swift::PatternBindingEntryRequest const&, swift::PatternBindingEntryRequest::OutputType swift::evaluateOrDefault<swift::PatternBindingEntryRequest>(swift::Evaluator&, swift::PatternBindingEntryRequest, swift::PatternBindingEntryRequest::OutputType)::'lambda'()) + 212
54 swift-frontend           0x00000001042eaf4c swift::PatternBindingDecl::getCheckedPatternBindingEntry(unsigned int) const + 132
55 swift-frontend           0x0000000103f63e40 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 1092
56 swift-frontend           0x0000000103f639e8 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 136
57 swift-frontend           0x0000000103fec808 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 144
58 swift-frontend           0x0000000103feadbc bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 136
59 swift-frontend           0x0000000103fed1f4 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 2684
60 swift-frontend           0x0000000103fec744 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::Stmt>(swift::Stmt*&) + 136
61 swift-frontend           0x0000000103fe91d4 (anonymous namespace)::StmtChecker::typeCheckASTNode(swift::ASTNode&) + 176
62 swift-frontend           0x0000000103fec808 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 144
63 swift-frontend           0x0000000103feadbc bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 136
64 swift-frontend           0x0000000103fea538 (anonymous namespace)::StmtChecker::typeCheckBody(swift::BraceStmt*&) + 32
65 swift-frontend           0x0000000103fea374 swift::TypeCheckFunctionBodyRequest::evaluate(swift::Evaluator&, swift::AbstractFunctionDecl*) const + 1068
66 swift-frontend           0x0000000104393964 swift::TypeCheckFunctionBodyRequest::OutputType swift::Evaluator::getResultUncached<swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType)::'lambda'()>(swift::TypeCheckFunctionBodyRequest const&, swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType)::'lambda'()) + 224
67 swift-frontend           0x000000010430224c swift::AbstractFunctionDecl::getTypecheckedBody() const + 120
68 swift-frontend           0x000000010443d5e4 swift::SourceFile::typeCheckDelayedFunctions() + 104
69 swift-frontend           0x0000000104027994 swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 240
70 swift-frontend           0x00000001040293e0 swift::TypeCheckSourceFileRequest::OutputType swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()>(swift::TypeCheckSourceFileRequest const&, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()) + 216
71 swift-frontend           0x000000010402787c swift::performTypeChecking(swift::SourceFile&) + 84
72 swift-frontend           0x0000000102f4a2b4 bool llvm::function_ref<bool (swift::SourceFile&)>::callback_fn<swift::CompilerInstance::performSema()::$_8>(long, swift::SourceFile&) + 16
73 swift-frontend           0x0000000102f435b0 swift::CompilerInstance::forEachFileToTypeCheck(llvm::function_ref<bool (swift::SourceFile&)>) + 156
74 swift-frontend           0x0000000102f434f4 swift::CompilerInstance::performSema() + 76
75 swift-frontend           0x0000000102cffc6c withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 60
76 swift-frontend           0x0000000102cf4f2c performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 708
77 swift-frontend           0x0000000102cf46cc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2264
78 swift-frontend           0x0000000102ae80dc swift::mainEntry(int, char const**) + 3108
79 dyld                     0x0000000185f70274 start + 2840

Expected behavior

No assert

Environment

Swift version 6.1-dev (LLVM fe0f467028c23cf, Swift 614e8aa79a84486)

Additional information

@susmonteiro fyi

rjmansfield commented 1 week ago

Worked around in 9f3dad40965688556197d5f4ac66bc5f07374d77