Compiler crashes when calling function from another file which uses global variable #81818
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Description
When building a simple executable target with main.swift which imports Foundation and defines global variable via
let
and a function which uses that global variable, when that function is called from another file, the crash happens.Reproduction
Create new swift package with a single executable target and files:
main.swift
Ext.swift
Some.swift
try to run
swift build
it crashes with a stack dump
attaching the code archive:
MyTool.zip
Stack dump
Expected behavior
My could would compile and run without any problems.
Environment
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: x86_64-apple-macosx15.0
Additional information
No response
The text was updated successfully, but these errors were encountered: