Leaving this here in case you want to report a bug to the Swift team, if you get the chance to create a minimal repro
Otherwise I'm going to take a stab a it when I have some time
[...]
building playdatekittemplate_device.o
Assertion failed: (NextValue < Values.size()), function claimNext, file Explosion.h, line 136.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/angelo/Projects/External/PlaydateKitTemplate/Sources/PlaydateKitTemplate/Game.swift /Users/angelo/Projects/External/PlaydateKitTemplate/Sources/PlaydateKitTemplate/entry.swift -target armv7em-none-none-eabi -disable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -I /Users/angelo/Developer/PlaydateSDK/C_API -I /Users/angelo/Projects/External/PlaydateKitTemplate/.build/plugins/PDCPlugin/outputs/Modules -I /Users/angelo/Projects/External/PlaydateKitTemplate/.build/checkouts/PlaydateKit/Sources/CPlaydate/include -module-cache-path /Users/angelo/Projects/External/PlaydateKitTemplate/.build/plugins/PDCPlugin/outputs/module-cache -swift-version 6 -Osize -disable-stack-protector -function-sections -experimental-platform-c-calling-convention=arm_aapcs_vfp -enable-experimental-feature Embedded -module-alias PlaydateKit=playdatekit_device -empty-abi-descriptor -resource-dir /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/lib/swift -Xcc -I -Xcc /usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/include -Xcc -I -Xcc /usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/include-fixed -Xcc -I -Xcc /usr/local/playdate/gcc-arm-none-eabi-9-2019-q4-major/lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/include -Xcc -DTARGET_EXTENSION -Xcc -mthumb -Xcc -mcpu=cortex-m7 -Xcc -mfloat-abi=hard -Xcc -mfpu=fpv5-sp-d16 -Xcc -D__FPU_USED=1 -Xcc -falign-functions=16 -Xcc -fshort-enums -module-name playdatekittemplate_device -plugin-path /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-13-a.xctoolchain/usr/local/lib/swift/host/plugins -enable-default-cmo -o /Users/angelo/Projects/External/PlaydateKitTemplate/.build/plugins/PDCPlugin/outputs/playdatekittemplate_device.o
1. Apple Swift version 6.0-dev (LLVM d1625da873daa4c, Swift bae6450bf96dceb)
2. Compiling with the current language version
3. While evaluating request IRGenRequest(IR Generation for module playdatekittemplate_device)
4. While emitting IR SIL function "@$s26playdatekittemplate_device4GameCACycfcys13OpaquePointerVSg_So6PDRectaAHtcfU_To".
for expression at [/Users/angelo/Projects/External/PlaydateKitTemplate/Sources/PlaydateKitTemplate/Game.swift:7:50 - line:9:9] RangeText="{ sprite,bounds,drawRect in
System.log("Draw function")
"
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 0x000000010842e754 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x000000010842cf20 llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x000000010842ed9c SignalHandler(int) + 304
3 libsystem_platform.dylib 0x000000018f8c1a24 _sigtramp + 56
4 libsystem_pthread.dylib 0x000000018f892cc0 pthread_kill + 288
5 libsystem_c.dylib 0x000000018f7a2a50 abort + 180
6 libsystem_c.dylib 0x000000018f7a1d6c err + 0
7 swift-frontend 0x0000000108489230 swift::irgen::emitForeignParameter(swift::irgen::IRGenFunction&, swift::irgen::Explosion&, swift::irgen::ForeignFunctionInfo, unsigned int, swift::SILType, swift::irgen::LoadableTypeInfo const&, swift::irgen::Explosion&, bool) (.cold.12) + 0
8 swift-frontend 0x0000000103381350 swift::irgen::emitForeignParameter(swift::irgen::IRGenFunction&, swift::irgen::Explosion&, swift::irgen::ForeignFunctionInfo, unsigned int, swift::SILType, swift::irgen::LoadableTypeInfo const&, swift::irgen::Explosion&, bool) + 1724
9 swift-frontend 0x00000001035335ec (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 3328
10 swift-frontend 0x00000001035323a4 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1524
11 swift-frontend 0x00000001033d7230 swift::irgen::IRGenerator::emitGlobalTopLevel(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 740
12 swift-frontend 0x00000001034e5208 swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 2160
13 swift-frontend 0x00000001035318a4 swift::GeneratedModule swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 200
14 swift-frontend 0x00000001034eda78 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached<swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()>(swift::IRGenRequest const&, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()) + 212
15 swift-frontend 0x00000001034e62c8 swift::performIRGeneration(swift::ModuleDecl*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, llvm::GlobalVariable**) + 1400
16 swift-frontend 0x0000000103000ba4 generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 272
17 swift-frontend 0x0000000102ffcdd4 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 1416
18 swift-frontend 0x0000000102ffc4a0 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1164
19 swift-frontend 0x000000010300d430 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 160
20 swift-frontend 0x0000000102ffe88c performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 708
21 swift-frontend 0x0000000102ffd7f8 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2368
22 swift-frontend 0x0000000102e17c74 swift::mainEntry(int, char const**) + 3096
23 dyld 0x000000018f519058 start + 2224
building pdex.dylib
error: swiftcFailed(exitCode: 6)
Having an empty function or any code seems to produce the same or very similar error when compiling.