Open
Description
Description
No matter whether the type is a structure, a tuple, or a primitive, the compiler crashes when creating an InlineArray
from a literal. This works fine in the REPL, but SourceKit doesn’t seem to like it either. I’ve only tested this on MacOS with the latest main snapshot.
Reproduction
// Don’t mind the name; I just kept it to match up with the stack trace.
@main
struct AddressableTests {
static func main() {
let testArr: InlineArray<2, Int> = [
2,
4
]
}
}
Stack dump
error: compile command failed due to signal 6 (use -v to see invocation)
Assertion failed: ((TranslationSemantics::LookThrough != TranslationSemantics::LookThrough || isStaticallyLookThroughInst(inst)) && "Out of sync?!"), function visitVectorBaseAddrInst, file RegionAnalysis.cpp, line 3414.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/Sources/AddressableTests/AddressableTests.swift -emit-dependencies-path /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/.build/arm64-apple-macosx/debug/AddressableTests.build/AddressableTests.d -emit-reference-dependencies-path /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/.build/arm64-apple-macosx/debug/AddressableTests.build/AddressableTests.swiftdeps -serialize-diagnostics-path /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/.build/arm64-apple-macosx/debug/AddressableTests.build/AddressableTests.dia -target arm64-apple-macosx10.13 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk -I /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/.build/arm64-apple-macosx/debug/Modules -I /Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/lib/swift/macosx/testing -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -color-diagnostics -Xcc -fcolor-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/.build/arm64-apple-macosx/debug/ModuleCache -swift-version 6 -Onone -D SWIFT_PACKAGE -D DEBUG -D SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE -entry-point-function-name AddressableTests_main -disable-availability-checking -empty-abi-descriptor -plugin-path /Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/lib/swift/host/plugins/testing -enable-anonymous-context-mangled-names -file-compilation-dir /Users/hbaker/XcodeProjects/ForumTests/AddressableTests -Xcc -isysroot -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -Xcc -fPIC -Xcc -g -no-auto-bridging-header-chaining -module-name AddressableTests -package-name addressabletests -in-process-plugin-server-path /Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/local/lib/swift/host/plugins -target-sdk-version 15.4 -target-sdk-name macosx15.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 -parse-as-library -o /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/.build/arm64-apple-macosx/debug/AddressableTests.build/AddressableTests.swift.o -index-store-path /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/.build/arm64-apple-macosx/debug/index/store -index-system-modules
1. Apple Swift version 6.2-dev (LLVM 3c4a54b02dd62b7, Swift a40a7be6945a895)
2. Compiling with the current language version
3. While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for AddressableTests)
4. While running pass #42 SILFunctionTransform "SendNonSendable" on SILFunction "@$s16AddressableTestsAAV4mainyyFZ".
for 'main()' (at /Users/hbaker/XcodeProjects/ForumTests/AddressableTests/Sources/AddressableTests/AddressableTests.swift:49:5)
#0 0x0000000109f35a5c (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1059f9a5c)
#1 0x0000000109f34188 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1059f8188)
#2 0x0000000109f360a4 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1059fa0a4)
#3 0x0000000195358704 (/usr/lib/system/libsystem_platform.dylib+0x1804cc704)
#4 0x000000019534e88c (/usr/lib/system/libsystem_pthread.dylib+0x1804c288c)
#5 0x00000001952557ac (/usr/lib/system/libsystem_c.dylib+0x1803c97ac)
#6 0x0000000195254a38 (/usr/lib/system/libsystem_c.dylib+0x1803c8a38)
#7 0x0000000109f81730 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x105a45730)
#8 0x0000000105283dc4 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100d47dc4)
#9 0x00000001052804bc (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100d444bc)
#10 0x000000010527f1b4 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100d431b4)
#11 0x0000000105279630 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100d3d630)
#12 0x0000000105296efc (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100d5aefc)
#13 0x000000010527af70 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100d3ef70)
#14 0x000000010527c2f0 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100d402f0)
#15 0x00000001054a851c (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f6c51c)
#16 0x00000001054a6aa4 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f6aaa4)
#17 0x00000001054c9fd0 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f8dfd0)
#18 0x00000001054cacf4 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f8ecf4)
#19 0x00000001054cd51c (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f9151c)
#20 0x00000001054c7f14 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f8bf14)
#21 0x00000001054c7e94 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f8be94)
#22 0x00000001054ee3b8 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100fb23b8)
#23 0x00000001054cf0c0 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f930c0)
#24 0x00000001054c8104 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f8c104)
#25 0x00000001054d0694 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100f94694)
#26 0x0000000104a23e2c (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1004e7e2c)
#27 0x00000001047e7928 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1002ab928)
#28 0x00000001047e6f88 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1002aaf88)
#29 0x00000001047f3684 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1002b7684)
#30 0x00000001047e8d80 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1002acd80)
#31 0x00000001047e853c (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x1002ac53c)
#32 0x0000000104575900 (/Users/hbaker/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-06-09-a.xctoolchain/usr/bin/swift-frontend+0x100039900)
#33 0x0000000194f99854
Expected behavior
I expect that this should statically initialize an InlineArray
.
Environment
Apple Swift version 6.2-dev (LLVM 3c4a54b02dd62b7, Swift a40a7be)
Target: arm64-apple-macosx16.0
Swiftly tag: main-snapshot-2025-06-09
Additional information
I saw another issue about a crash with InlineArray, but the error is quite different and this happens regardless of the build configuration.