swiftlang / swift

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

Compiler crash with typed throws in generic class. #77612

Open GetToSet opened 2 days ago

GetToSet commented 2 days ago

Description

No response

Reproduction

class ServiceError: Error { }

final class MyServiceError: ServiceError { }

protocol ViewModelProtocol {

  init()

  func fetchItems() throws(MyServiceError)

}

struct MyView<ViewModel> where ViewModel: ViewModelProtocol {

  private var viewModel = ViewModel()

  func refreshAction() throws(ServiceError) {
    try viewModel.fetchItems()
  }

}

Stack dump

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               swift-frontend [3015]
Path:                  /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend
Identifier:            swift-frontend
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        XCBBuildService [1195]
Responsible:           Xcode [994]
User ID:               501

Date/Time:             2024-11-14 22:17:02.2868 +0800
OS Version:            macOS 15.1 (24B83)
Report Version:        12
Anonymous UUID:        857E13E0-3E9E-116D-97ED-7BD9641A34CC

Time Awake Since Boot: 690 seconds

System Integrity Protection: disabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000068
Exception Codes:       0x0000000000000001, 0x0000000000000068

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [3015]

VM Region Info: 0x68 is not in any region.  Bytes before following region: 4297047960
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      1001fc000-107058000    [110.4M] r-x/r-x SM=COW  /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend

Kernel Triage:
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   swift-frontend                         0x100f70230 swift::Lowering::SILGenBuilder::bufferForExpr(swift::SILLocation, swift::SILType, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext, llvm::function_ref<void (swift::SILValue)>) + 64
1   swift-frontend                         0x100f926e8 swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool) + 752
2   swift-frontend                         0x1010705b0 swift::Lowering::SILGenFunction::emitThrow(swift::SILLocation, swift::Lowering::ManagedValue, bool) + 2764
3   swift-frontend                         0x10106fa08 swift::Lowering::SILGenFunction::getTryApplyErrorDest(swift::SILLocation, swift::CanTypeWrapper<swift::SILFunctionType>, swift::Lowering::ExecutorBreadcrumb, swift::SILResultInfo, swift::SILValue, bool) + 540
4   swift-frontend                         0x100f3e2d0 emitRawApply(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::SubstitutionMap, llvm::ArrayRef<swift::Lowering::ManagedValue>, swift::CanTypeWrapper<swift::SILFunctionType>, swift::optionset::OptionSet<swift::ApplyFlags, unsigned char>, llvm::ArrayRef<swift::SILValue>, swift::SILValue, llvm::SmallVectorImpl<swift::SILValue>&, swift::Lowering::ExecutorBreadcrumb) + 2724
5   swift-frontend                         0x100f3ec84 swift::Lowering::SILGenFunction::emitApply(std::__1::unique_ptr<swift::Lowering::ResultPlan, std::__1::default_delete<swift::Lowering::ResultPlan>>&&, swift::Lowering::ArgumentScope&&, swift::SILLocation, swift::Lowering::ManagedValue, swift::SubstitutionMap, llvm::ArrayRef<swift::Lowering::ManagedValue>, swift::Lowering::CalleeTypeInfo const&, swift::optionset::OptionSet<swift::ApplyFlags, unsigned char>, swift::Lowering::SGFContext, std::__1::optional<swift::ActorIsolation>) + 2276
6   swift-frontend                         0x100f45d64 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 2240
7   swift-frontend                         0x100f4421c swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 3116
8   swift-frontend                         0x100fb4a88 swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 888
9   swift-frontend                         0x10106c088 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 5512
10  swift-frontend                         0x100fe3ddc swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 492
11  swift-frontend                         0x100f2f930 swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 8420
12  swift-frontend                         0x100f301d0 swift::Lowering::SILGenModule::emitOrDelayFunction(swift::SILDeclRef) + 216
13  swift-frontend                         0x100f2d800 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 364
14  swift-frontend                         0x101083aa0 (anonymous namespace)::SILGenType::visitFuncDecl(swift::FuncDecl*) + 32
15  swift-frontend                         0x101080048 (anonymous namespace)::SILGenType::emitType() + 424
16  swift-frontend                         0x100f2d438 swift::ASTVisitor<swift::Lowering::SILGenModule, void, void, void, void, void, void>::visit(swift::Decl*) + 104
17  swift-frontend                         0x100f33e4c swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 1804
18  swift-frontend                         0x10106a740 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 196
19  swift-frontend                         0x100f38d28 swift::ASTLoweringRequest::OutputType swift::Evaluator::getResultUncached<swift::ASTLoweringRequest, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()>(swift::ASTLoweringRequest const&, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()) + 528
20  swift-frontend                         0x100512e7c swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 920
21  swift-frontend                         0x100516174 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1684
22  swift-frontend                         0x100514ea0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3572
23  swift-frontend                         0x10049bf64 swift::mainEntry(int, char const**) + 3680
24  dyld                                   0x183a48274 start + 2840

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000148c9f490   x2: 0x000000016fbf8ee0   x3: 0x0000000101cc4770
    x4: 0x7d96d23d049b2be9   x5: 0x000000016fbf8f68   x6: 0x0000000148d767c8   x7: 0x000000016fbf7ca8
    x8: 0x00000000ffffffff   x9: 0x0000000105bb8917  x10: 0x0000000100f926e4  x11: 0x0000000000000069
   x12: 0x9ddfea08eb382d69  x13: 0x0000000759c16b48  x14: 0x7637fa49b4dac1f3  x15: 0xc949d7c7509e6557
   x16: 0xd33509d543820278  x17: 0x0000000000000044  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x7d96d23d049b2be9  x21: 0x000000016fbf8f68  x22: 0x0000000148d767c8  x23: 0x000000016fbf7ca8
   x24: 0x0000000000000000  x25: 0x000000016fbf8ee0  x26: 0x0000000148c9f490  x27: 0x0000000101cc4770
   x28: 0x000000016fbf93f8   fp: 0x000000016fbf9050   lr: 0x0000000100f926e8
    sp: 0x000000016fbf9000   pc: 0x0000000100f70230 cpsr: 0x00001000
   far: 0x0000000000000068  esr: 0x92000006 (Data Abort) byte read Translation fault

Binary Images:
       0x1001fc000 -        0x107057fff swift-frontend (*) <e175120c-ba05-31e0-bd55-bcb2308b0fce> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend
       0x1091a4000 -        0x1091b3fff libSwiftIDEUtils.dylib (*) <be797c08-283d-3508-80aa-39fb6b09ca96> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftIDEUtils.dylib
       0x10938c000 -        0x1093d3fff libSwiftCompilerPluginMessageHandling.dylib (*) <e95a689b-8dfb-34e2-8a1d-702629939fa4> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftCompilerPluginMessageHandling.dylib
       0x10913c000 -        0x109163fff libSwiftSyntaxMacroExpansion.dylib (*) <2cf5c8da-d437-3689-a3be-32ee46873709> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntaxMacroExpansion.dylib
       0x109264000 -        0x10927ffff libSwiftOperators.dylib (*) <88b9cec8-d009-3c69-966d-06d2c8455596> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftOperators.dylib
       0x109224000 -        0x10922bfff libSwiftSyntaxMacros.dylib (*) <f1b4f087-4d4d-33ab-b9b6-a481850a5d52> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntaxMacros.dylib
       0x109644000 -        0x109677fff libSwiftSyntaxBuilder.dylib (*) <2a66779a-e6d7-36c9-bc6a-ab5446821cad> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntaxBuilder.dylib
       0x109468000 -        0x1094c3fff libSwiftParserDiagnostics.dylib (*) <c787f88c-af7a-39f5-89da-e16abcbc3d2b> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftParserDiagnostics.dylib
       0x1091d8000 -        0x1091e7fff libSwiftBasicFormat.dylib (*) <b0e276a9-3d1b-3a6d-872e-6119469d912a> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftBasicFormat.dylib
       0x109b50000 -        0x109c2ffff libSwiftParser.dylib (*) <08b3f383-ec09-3b1d-8dcc-c9479f87e69a> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftParser.dylib
       0x109310000 -        0x109323fff libSwiftDiagnostics.dylib (*) <708b2692-f7ca-30a8-9ae4-b7db0f29c5f5> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftDiagnostics.dylib
       0x10b574000 -        0x10b8dffff libSwiftSyntax.dylib (*) <53c8f71f-807e-3002-a921-07d8266d8a3c> /Applications/Xcode-16.1.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib
       0x183a42000 -        0x183ac47b3 dyld (*) <6beafde4-b011-3e47-8aae-4d7b6e4bb7e8> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=751.4M resident=0K(0%) swapped_out_or_unallocated=751.4M(100%)
Writable regions: Total=1.1G written=546K(0%) resident=546K(0%) swapped_out=0K(0%) unallocated=1.1G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                   32K        1 
MALLOC                             1.1G       39 
MALLOC guard page                   96K        6 
STACK GUARD                       56.0M        1 
Stack                             8176K        1 
VM_ALLOCATE (reserved)             256K        1         reserved VM address space (unallocated)
__AUTH                             103K       16 
__AUTH_CONST                       305K       54 
__DATA                            2258K       70 
__DATA_CONST                      4758K       66 
__DATA_DIRTY                       163K       23 
__LINKEDIT                       623.8M       13 
__OBJC_RW                         2354K        1 
__TEXT                           127.5M       68 
__TPRO_CONST                       272K        2 
mapped file                      112.4M      163 
page table in kernel               546K        1 
shared memory                       32K        1 
===========                     =======  ======= 
TOTAL                              2.0G      527 
TOTAL, minus reserved VM space     2.0G      527 

-----------
Full Report
-----------

{"app_name":"swift-frontend","timestamp":"2024-11-14 22:17:02.00 +0800","app_version":"","slice_uuid":"e175120c-ba05-31e0-bd55-bcb2308b0fce","build_version":"","platform":1,"share_with_app_devs":1,"is_first_party":1,"bug_type":"309","os_version":"macOS 15.1 (24B83)","roots_installed":0,"incident_id":"95A1D797-B630-4518-A515-2BF8C12F59F9","name":"swift-frontend"}
{
  "uptime" : 690,
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "Mac14,2",
  "coalitionID" : 1163,
  "osVersion" : {
    "train" : "macOS 15.1",
    "build" : "24B83",
    "releaseType" : "User"
  },
  "captureTime" : "2024-11-14 22:17:02.2868 +0800",
  "codeSigningMonitor" : 1,
  "incident" : "95A1D797-B630-4518-A515-2BF8C12F59F9",
  "pid" : 3015,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2024-11-14 22:17:02.1548 +0800",
  "procStartAbsTime" : 16584873891,
  "procExitAbsTime" : 16588034811,
  "procName" : "swift-frontend",
  "procPath" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/swift-frontend",
  "parentProc" : "XCBBuildService",
  "parentPid" : 1195,
  "coalitionName" : "com.apple.dt.Xcode",
  "crashReporterKey" : "857E13E0-3E9E-116D-97ED-7BD9641A34CC",
  "responsiblePid" : 994,
  "responsibleProc" : "Xcode",
  "codeSigningID" : "com.apple.swift-frontend",
  "codeSigningTeamID" : "",
  "codeSigningFlags" : 570442241,
  "codeSigningValidationCategory" : 1,
  "codeSigningTrustLevel" : 4294967295,
  "instructionByteStream" : {"beforePC":"\/UMBkfcDB6r2Awaq9AMEqvsDA6r5AwKq+gMBqvMDAKq18H3ygAIAVA==","atPC":"eDZA+agCQPkICUD54AMVqgABP9bAAQA0qAJA+QgRQPngAxWq4QMYqg=="},
  "bootSessionUUID" : "BE39B8B8-4AA3-46EA-9147-2F2444B08E75",
  "sip" : "disabled",
  "vmRegionInfo" : "0x68 is not in any region.  Bytes before following region: 4297047960\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      UNUSED SPACE AT START\n--->  \n      __TEXT                      1001fc000-107058000    [110.4M] r-x\/r-x SM=COW  \/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/swift-frontend",
  "exception" : {"codes":"0x0000000000000001, 0x0000000000000068","rawCodes":[1,104],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000000000000068"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":3015},
  "ktriageinfo" : "VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter\n",
  "vmregioninfo" : "0x68 is not in any region.  Bytes before following region: 4297047960\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      UNUSED SPACE AT START\n--->  \n      __TEXT                      1001fc000-107058000    [110.4M] r-x\/r-x SM=COW  \/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/swift-frontend",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":29230,"threadState":{"x":[{"value":0},{"value":5516162192},{"value":6169792224},{"value":4325132144,"symbolLocation":0,"symbol":"swift::AnyRequestVTable::Impl<swift::LookupConformanceInModuleRequest>::isEqual(void const*, void const*)"},{"value":9049651660759706601},{"value":6169792360},{"value":5517043656},{"value":6169787560},{"value":4294967295},{"value":4391143703,"symbolLocation":2487,"symbol":"llvm::hexDigitValue(char)::LUT"},{"value":4311295716,"symbolLocation":748,"symbol":"swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool)"},{"value":105},{"value":11376068507788127593},{"value":31570619208},{"value":8518552414668374515},{"value":14504361325974414679},{"value":15219081327333737080},{"value":68},{"value":0},{"value":0},{"value":9049651660759706601},{"value":6169792360},{"value":5517043656},{"value":6169787560},{"value":0},{"value":6169792224},{"value":5516162192},{"value":4325132144,"symbolLocation":0,"symbol":"swift::AnyRequestVTable::Impl<swift::LookupConformanceInModuleRequest>::isEqual(void const*, void const*)"},{"value":6169793528}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4311295720},"cpsr":{"value":4096},"fp":{"value":6169792592},"sp":{"value":6169792512},"esr":{"value":2449473542,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":4311155248,"matchesCrashFrame":1},"far":{"value":104}},"queue":"com.apple.main-thread","frames":[{"imageOffset":14107184,"symbol":"swift::Lowering::SILGenBuilder::bufferForExpr(swift::SILLocation, swift::SILType, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext, llvm::function_ref<void (swift::SILValue)>)","symbolLocation":64,"imageIndex":0},{"imageOffset":14247656,"symbol":"swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool)","symbolLocation":752,"imageIndex":0},{"imageOffset":15156656,"symbol":"swift::Lowering::SILGenFunction::emitThrow(swift::SILLocation, swift::Lowering::ManagedValue, bool)","symbolLocation":2764,"imageIndex":0},{"imageOffset":15153672,"symbol":"swift::Lowering::SILGenFunction::getTryApplyErrorDest(swift::SILLocation, swift::CanTypeWrapper<swift::SILFunctionType>, swift::Lowering::ExecutorBreadcrumb, swift::SILResultInfo, swift::SILValue, bool)","symbolLocation":540,"imageIndex":0},{"imageOffset":13902544,"symbol":"emitRawApply(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::SubstitutionMap, llvm::ArrayRef<swift::Lowering::ManagedValue>, swift::CanTypeWrapper<swift::SILFunctionType>, swift::optionset::OptionSet<swift::ApplyFlags, unsigned char>, llvm::ArrayRef<swift::SILValue>, swift::SILValue, llvm::SmallVectorImpl<swift::SILValue>&, swift::Lowering::ExecutorBreadcrumb)","symbolLocation":2724,"imageIndex":0},{"imageOffset":13905028,"symbol":"swift::Lowering::SILGenFunction::emitApply(std::__1::unique_ptr<swift::Lowering::ResultPlan, std::__1::default_delete<swift::Lowering::ResultPlan>>&&, swift::Lowering::ArgumentScope&&, swift::SILLocation, swift::Lowering::ManagedValue, swift::SubstitutionMap, llvm::ArrayRef<swift::Lowering::ManagedValue>, swift::Lowering::CalleeTypeInfo const&, swift::optionset::OptionSet<swift::ApplyFlags, unsigned char>, swift::Lowering::SGFContext, std::__1::optional<swift::ActorIsolation>)","symbolLocation":2276,"imageIndex":0},{"imageOffset":13933924,"symbol":"(anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext)","symbolLocation":2240,"imageIndex":0},{"imageOffset":13926940,"symbol":"swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext)","symbolLocation":3116,"imageIndex":0},{"imageOffset":14387848,"symbol":"swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*)","symbolLocation":888,"imageIndex":0},{"imageOffset":15138952,"symbol":"swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*)","symbolLocation":5512,"imageIndex":0},{"imageOffset":14581212,"symbol":"swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*)","symbolLocation":492,"imageIndex":0},{"imageOffset":13842736,"symbol":"swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*)","symbolLocation":8420,"imageIndex":0},{"imageOffset":13844944,"symbol":"swift::Lowering::SILGenModule::emitOrDelayFunction(swift::SILDeclRef)","symbolLocation":216,"imageIndex":0},{"imageOffset":13834240,"symbol":"swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*)","symbolLocation":364,"imageIndex":0},{"imageOffset":15235744,"symbol":"(anonymous namespace)::SILGenType::visitFuncDecl(swift::FuncDecl*)","symbolLocation":32,"imageIndex":0},{"imageOffset":15220808,"symbol":"(anonymous namespace)::SILGenType::emitType()","symbolLocation":424,"imageIndex":0},{"imageOffset":13833272,"symbol":"swift::ASTVisitor<swift::Lowering::SILGenModule, void, void, void, void, void, void>::visit(swift::Decl*)","symbolLocation":104,"imageIndex":0},{"imageOffset":13860428,"symbol":"swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const","symbolLocation":1804,"imageIndex":0},{"imageOffset":15132480,"symbol":"swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&)","symbolLocation":196,"imageIndex":0},{"imageOffset":13880616,"symbol":"swift::ASTLoweringRequest::OutputType swift::Evaluator::getResultUncached<swift::ASTLoweringRequest, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()>(swift::ASTLoweringRequest const&, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'())","symbolLocation":528,"imageIndex":0},{"imageOffset":3239548,"symbol":"swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*)","symbolLocation":920,"imageIndex":0},{"imageOffset":3252596,"symbol":"performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*)","symbolLocation":1684,"imageIndex":0},{"imageOffset":3247776,"symbol":"swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)","symbolLocation":3572,"imageIndex":0},{"imageOffset":2752356,"symbol":"swift::mainEntry(int, char const**)","symbolLocation":3680,"imageIndex":0},{"imageOffset":25204,"symbol":"start","symbolLocation":2840,"imageIndex":12}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4297048064,
    "size" : 115720192,
    "uuid" : "e175120c-ba05-31e0-bd55-bcb2308b0fce",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/swift-frontend",
    "name" : "swift-frontend"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4447682560,
    "size" : 65536,
    "uuid" : "be797c08-283d-3508-80aa-39fb6b09ca96",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftIDEUtils.dylib",
    "name" : "libSwiftIDEUtils.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4449681408,
    "size" : 294912,
    "uuid" : "e95a689b-8dfb-34e2-8a1d-702629939fa4",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftCompilerPluginMessageHandling.dylib",
    "name" : "libSwiftCompilerPluginMessageHandling.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4447256576,
    "size" : 163840,
    "uuid" : "2cf5c8da-d437-3689-a3be-32ee46873709",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftSyntaxMacroExpansion.dylib",
    "name" : "libSwiftSyntaxMacroExpansion.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4448468992,
    "size" : 114688,
    "uuid" : "88b9cec8-d009-3c69-966d-06d2c8455596",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftOperators.dylib",
    "name" : "libSwiftOperators.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4448206848,
    "size" : 32768,
    "uuid" : "f1b4f087-4d4d-33ab-b9b6-a481850a5d52",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftSyntaxMacros.dylib",
    "name" : "libSwiftSyntaxMacros.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4452532224,
    "size" : 212992,
    "uuid" : "2a66779a-e6d7-36c9-bc6a-ab5446821cad",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftSyntaxBuilder.dylib",
    "name" : "libSwiftSyntaxBuilder.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4450582528,
    "size" : 376832,
    "uuid" : "c787f88c-af7a-39f5-89da-e16abcbc3d2b",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftParserDiagnostics.dylib",
    "name" : "libSwiftParserDiagnostics.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4447895552,
    "size" : 65536,
    "uuid" : "b0e276a9-3d1b-3a6d-872e-6119469d912a",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftBasicFormat.dylib",
    "name" : "libSwiftBasicFormat.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4457824256,
    "size" : 917504,
    "uuid" : "08b3f383-ec09-3b1d-8dcc-c9479f87e69a",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftParser.dylib",
    "name" : "libSwiftParser.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4449173504,
    "size" : 81920,
    "uuid" : "708b2692-f7ca-30a8-9ae4-b7db0f29c5f5",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftDiagnostics.dylib",
    "name" : "libSwiftDiagnostics.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4485234688,
    "size" : 3588096,
    "uuid" : "53c8f71f-807e-3002-a921-07d8266d8a3c",
    "path" : "\/Applications\/Xcode-16.1.0.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/swift\/host\/libSwiftSyntax.dylib",
    "name" : "libSwiftSyntax.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6503538688,
    "size" : 534452,
    "uuid" : "6beafde4-b011-3e47-8aae-4d7b6e4bb7e8",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 6502727680,
  "size" : 4753752064,
  "uuid" : "58694c6f-fec3-316e-a11c-b2fa3c2f6559"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=751.4M resident=0K(0%) swapped_out_or_unallocated=751.4M(100%)\nWritable regions: Total=1.1G written=546K(0%) resident=546K(0%) swapped_out=0K(0%) unallocated=1.1G(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nKernel Alloc Once                   32K        1 \nMALLOC                             1.1G       39 \nMALLOC guard page                   96K        6 \nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \nVM_ALLOCATE (reserved)             256K        1         reserved VM address space (unallocated)\n__AUTH                             103K       16 \n__AUTH_CONST                       305K       54 \n__DATA                            2258K       70 \n__DATA_CONST                      4758K       66 \n__DATA_DIRTY                       163K       23 \n__LINKEDIT                       623.8M       13 \n__OBJC_RW                         2354K        1 \n__TEXT                           127.5M       68 \n__TPRO_CONST                       272K        2 \nmapped file                      112.4M      163 \npage table in kernel               546K        1 \nshared memory                       32K        1 \n===========                     =======  ======= \nTOTAL                              2.0G      527 \nTOTAL, minus reserved VM space     2.0G      527 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "logWritingSignature" : "e058a0cd35cedd739e1d376a9a444621cad63dab",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "658361a603dc58766bab2d2a",
      "factorPackIds" : {

      },
      "deploymentId" : 240000043
    },
    {
      "rolloutId" : "60186475825c62000ccf5450",
      "factorPackIds" : {

      },
      "deploymentId" : 240000083
    }
  ],
  "experiments" : [

  ]
}
}

Expected behavior

The attached code should compile without compiler crash.

Environment

swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4) Target: arm64-apple-macosx15.0

Additional information

Reproducible using Xcode 16.1 (16B40)