Avatar
Avatar
treastrain / Tanaka.R
@swift-6.2.1 import Foundation struct GlobalValues { @TaskLocal static var property1 = 1 @TaskLocal static var property2: String = "Hello" @TaskLocal static var property3: Int? = nil var number = 1 } @inlinable @discardableResult public func withTaskLocalValues<each Value, Result, Failure>( _ taskLocalValuesDuringOperation: repeat (TaskLocal<each Value>, each Value), operation: () throws(Failure) -> Result, file: String = #fileID, line: UInt = #line ) throws(Failure) -> Result { try withoutActuallyEscaping(operation) { operation throws(Failure) -> Result in var operation = operation for (taskLocal, valueDuringOperation) in repeat each taskLocalValuesDuringOperation { operation = { [operation] () throws(Failure) -> Result in do { return try taskLocal.withValue(valueDuringOperation, operation: operation, file: file, line: line) } catch { throw error as! Failure } } } return try operation() } } withTaskLocalValues( (GlobalValues.$property1, 2), (GlobalValues.$property2, "World"), (GlobalValues.$property3, 4), ) { print(GlobalValues.property1, GlobalValues.property2, "\(GlobalValues.property3, default: "nil")") }
signal: segmentation fault (core dumped) with stderr:Stack dump: 0. Program arguments: /usr/bin/swift-frontend -frontend -interpret - -Xllvm -aarch64-use-tbi -disable-objc-interop -no-color-diagnostics -Xcc -fno-color-diagnostics -empty-abi-descriptor -no-auto-bridging-header-chaining -module-name main -in-process-plugin-server-path /usr/lib/swift/host/libSwiftInProcPluginServer.so -plugin-path /usr/lib/swift/host/plugins -plugin-path /usr/local/lib/swift/host/plugins 1. Swift version 6.2 (swift-6.2-RELEASE) 2. Compiling with effective version 5.10 3. While running user code "<stdin>" 4. While evaluating request IRGenRequest(IR Generation for module main) 5. While emitting IR SIL function "@$sq_q0_Iegrzr_q_s5Error_pIegrzo_Rvzs8SendableRzsAAR0_sABRd__r1__lTR". for <<debugloc at "<compiler-generated>":0:0>> #0 0x0000ba9b03af6820 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/bin/swift-frontend+0x6b36820) #1 0x0000ba9b03af4820 llvm::sys::RunSignalHandlers() (/usr/bin/swift-frontend+0x6b34820) #2 0x0000ba9b03af6f34 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0 #3 0x0000fd798b6168f8 (linux-vdso.so.1+0x8f8) #4 0x0000ba9afe11d41c swift::irgen::FulfillmentMap::searchTypeMetadata(swift::irgen::IRGenModule&, swift::CanType, swift::irgen::IsExact_t, swift::MetadataState, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) (/usr/bin/swift-frontend+0x115d41c) #5 0x0000ba9afe114468 swift::irgen::LocalTypeDataCache::addAbstractForTypeMetadata(swift::irgen::IRGenFunction&, swift::CanType, swift::irgen::IsExact_t, swift::irgen::MetadataResponse) (/usr/bin/swift-frontend+0x1154468) #6 0x0000ba9afe1143b4 swift::irgen::IRGenFunction::bindLocalTypeDataFromTypeMetadata(swift::CanType, swift::irgen::IsExact_t, llvm::Value*, swift::MetadataState) (/usr/bin/swift-frontend+0x11543b4) #7 0x0000ba9afe082634 swift::irgen::bindGenericRequirement(swift::irgen::IRGenFunction&, swift::GenericRequirement, llvm::V
23.44 KB
😭 1