-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathAttachment.swift
More file actions
612 lines (560 loc) · 24.3 KB
/
Attachment.swift
File metadata and controls
612 lines (560 loc) · 24.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
//
private import _TestingInternals
#if !SWT_NO_FILE_CLONING
private import _TestingInternals.StubsOnly
#endif
/// A type describing values that can be attached to the output of a test run
/// and inspected later by the user.
///
/// To create an attachment, you need a value of some type that conforms to
/// ``Attachable``. Initialize an instance of ``Attachment`` with that value
/// and, optionally, a preferred filename to use when saving the attachment. To
/// record the attachment, call ``Attachment/record(_:sourceLocation:)``.
/// Alternatively, pass your attachable value directly to ``Attachment/record(_:named:sourceLocation:)``.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
public struct Attachment<AttachableValue> where AttachableValue: Attachable & ~Copyable {
/// Storage for ``attachableValue-7dyjv``.
private var _storage: Allocated<AttachableValue>
/// The path to which the this attachment was saved, if any.
///
/// If a developer sets the ``Configuration/attachmentsPath`` property of the
/// current configuration before running tests, or if a developer passes
/// `--attachments-path` on the command line, then attachments will be
/// automatically saved when they are attached and the value of this property
/// will describe the paths where they were saved. A developer can use the
/// ``AttachmentSavingTrait`` trait type to defer or skip saving attachments.
///
/// If no destination path is set, or if an error occurred while saving this
/// attachment, the value of this property is `nil`.
@_spi(ForToolsIntegrationOnly)
public var fileSystemPath: String?
/// The default preferred name to use if the developer does not supply one.
package static var defaultPreferredName: String {
"untitled"
}
/// Storage for ``preferredName``.
fileprivate var _preferredName: String?
/// A filename to use when saving this attachment.
///
/// The value of this property is used as a hint to the testing library. The
/// testing library may substitute a different filename as needed. If the
/// value of this property has not been explicitly set, the testing library
/// will attempt to generate its own value.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
public var preferredName: String {
let suggestedName = if let _preferredName, !_preferredName.isEmpty {
_preferredName
} else {
Self.defaultPreferredName
}
return attachableValue.preferredName(for: self, basedOn: suggestedName)
}
/// The source location of this instance.
///
/// This property is not part of the public interface of the testing library.
/// It is initially set when the attachment is created and is updated later
/// when the attachment is attached to something.
///
/// The value of this property is used when recording issues associated with
/// the attachment.
@_spi(ForToolsIntegrationOnly)
public internal(set) var sourceLocation: SourceLocation
}
extension Attachment: Sendable where AttachableValue: Sendable & ~Copyable {}
// MARK: - Initializing an attachment
extension Attachment where AttachableValue: ~Copyable {
/// Initialize an instance of this type that encloses the given attachable
/// value.
///
/// - Parameters:
/// - attachableValue: The value that will be attached to the output of the
/// test run.
/// - preferredName: The preferred name of the attachment to use when saving
/// it. If `nil`, the testing library attempts to generate a reasonable
/// filename for the attached value.
/// - sourceLocation: The source location of the call to this initializer.
/// This value is used when recording issues associated with the
/// attachment.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
public init(_ attachableValue: consuming AttachableValue, named preferredName: String? = nil, sourceLocation: SourceLocation = #_sourceLocation) {
self._storage = Allocated(attachableValue)
self._preferredName = preferredName
self.sourceLocation = sourceLocation
}
}
/// A type-erased wrapper type that represents any attachable value.
///
/// This type is not generally visible to developers. It is used when posting
/// events of kind ``Event/Kind/valueAttached(_:)``. Test tools authors who use
/// `@_spi(ForToolsIntegrationOnly)` will see instances of this type when
/// handling those events.
///
/// @Comment {
/// Swift's type system requires that this type be at least as visible as
/// `Event.Kind.valueAttached(_:)`, otherwise it would be declared private.
/// }
@_spi(ForToolsIntegrationOnly)
public struct AnyAttachable: AttachableWrapper, Sendable, Copyable {
public struct Wrapped: Sendable {}
public var wrappedValue: Wrapped {
Wrapped()
}
init<A>(_ attachment: Attachment<A>) where A: Attachable & Sendable & ~Copyable {
_estimatedAttachmentByteCount = { attachment.attachableValue.estimatedAttachmentByteCount }
_withUnsafeBytes = { try attachment.withUnsafeBytes($0) }
_preferredName = { attachment.attachableValue.preferredName(for: attachment, basedOn: $0) }
#if !SWT_NO_FILE_CLONING
_clone = { attachment.attachableValue.clone(toFileAtPath: $0, for: attachment) }
#endif
}
/// The implementation of ``estimatedAttachmentByteCount`` borrowed from the
/// original attachment.
private var _estimatedAttachmentByteCount: @Sendable () -> Int?
public var estimatedAttachmentByteCount: Int? {
_estimatedAttachmentByteCount()
}
/// The implementation of ``withUnsafeBytes(for:_:)`` borrowed from the
/// original attachment.
private var _withUnsafeBytes: @Sendable ((UnsafeRawBufferPointer) throws -> Void) throws -> Void
public func withUnsafeBytes<R>(for attachment: borrowing Attachment<Self>, _ body: (UnsafeRawBufferPointer) throws -> R) throws -> R {
var result: R!
try _withUnsafeBytes { bytes in
result = try body(bytes)
}
return result
}
/// The implementation of ``preferredName(for:basedOn:)`` borrowed from the
/// original attachment.
private var _preferredName: @Sendable (String) -> String
public borrowing func preferredName(for attachment: borrowing Attachment<Self>, basedOn suggestedName: String) -> String {
_preferredName(suggestedName)
}
#if !SWT_NO_FILE_CLONING
/// The implementation of ``clone(toFileAtPath:)`` borrowed from the original
/// attachment.
private var _clone: @Sendable (String) -> Bool
package func clone(toFileAtPath filePath: String) -> Bool {
_clone(filePath)
}
#endif
}
extension Attachment<AnyAttachable> {
init(_ attachment: Attachment<some Attachable & Sendable & ~Copyable>) {
self.init(
AnyAttachable(copy attachment),
named: attachment._preferredName,
sourceLocation: attachment.sourceLocation
)
fileSystemPath = attachment.fileSystemPath
}
}
#if !SWT_NO_FILE_CLONING
extension AnyAttachable: FileClonable {}
#endif
// MARK: - Describing an attachment
@_preInverseGenerics
extension Attachment: CustomStringConvertible where AttachableValue: ~Copyable {
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
public var description: String {
if #available(_castingWithNonCopyableGenerics, *), let attachableValue = makeExistential(attachableValue) {
return #""\#(preferredName)": \#(String(describingForTest: attachableValue))"#
}
let typeInfo = TypeInfo(describing: AttachableValue.self)
return #""\#(preferredName)": instance of '\#(typeInfo.unqualifiedName)'"#
}
}
// MARK: - Getting an attachable value from an attachment
extension Attachment where AttachableValue: ~Copyable {
/// The value of this attachment.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
@_disfavoredOverload public var attachableValue: AttachableValue {
_read {
yield _storage.value
}
}
}
extension Attachment where AttachableValue: AttachableWrapper & ~Copyable {
/// The value of this attachment.
///
/// When the attachable value's type conforms to ``AttachableWrapper``, the
/// value of this property equals the wrapper's underlying attachable value.
/// To access the attachable value as an instance of `T` (where `T` conforms
/// to ``AttachableWrapper``), specify the type explicitly:
///
/// ```swift
/// let attachableValue = attachment.attachableValue as T
/// ```
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
public var attachableValue: AttachableValue.Wrapped {
_read {
yield attachableValue.wrappedValue
}
}
}
// MARK: - Attaching an attachment to a test (etc.)
extension Attachment where AttachableValue: Sendable & ~Copyable {
/// Attach an attachment to the current test.
///
/// - Parameters:
/// - attachment: The attachment to attach.
/// - sourceLocation: The source location of the call to this function.
///
/// When `attachableValue` is an instance of a type that does not conform to
/// the [`Sendable`](https://developer.apple.com/documentation/swift/sendable)
/// protocol, the testing library calls its ``Attachable/withUnsafeBytes(for:_:)``
/// immediately and records a copy of the resulting buffer instead. If
/// `attachableValue` throws an error when the testing library calls its
/// ``Attachable/withUnsafeBytes(for:_:)`` function, the testing library
/// records that error as an issue in the current test.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
@_documentation(visibility: private)
public static func record(_ attachment: consuming Self, sourceLocation: SourceLocation = #_sourceLocation) {
let attachmentCopy = Attachment<AnyAttachable>(attachment)
Event.post(.valueAttached(attachmentCopy))
}
/// Attach a value to the current test.
///
/// - Parameters:
/// - attachableValue: The value to attach.
/// - preferredName: The preferred name of the attachment to use when saving
/// it. If `nil`, the testing library attempts to generate a reasonable
/// filename for the attached value.
/// - sourceLocation: The source location of the call to this function.
///
/// When `attachableValue` is an instance of a type that does not conform to
/// the [`Sendable`](https://developer.apple.com/documentation/swift/sendable)
/// protocol, the testing library calls its ``Attachable/withUnsafeBytes(for:_:)``
/// immediately and records a copy of the resulting buffer instead. If
/// `attachableValue` throws an error when the testing library calls its
/// ``Attachable/withUnsafeBytes(for:_:)`` function, the testing library
/// records that error as an issue in the current test.
///
/// This function creates a new instance of ``Attachment`` and immediately
/// attaches it to the current test.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
@_documentation(visibility: private)
public static func record(_ attachableValue: consuming AttachableValue, named preferredName: String? = nil, sourceLocation: SourceLocation = #_sourceLocation) {
record(Self(attachableValue, named: preferredName, sourceLocation: sourceLocation), sourceLocation: sourceLocation)
}
}
extension Attachment where AttachableValue: ~Copyable {
/// Attach an attachment to the current test.
///
/// - Parameters:
/// - attachment: The attachment to attach.
/// - sourceLocation: The source location of the call to this function.
///
/// When `attachableValue` is an instance of a type that does not conform to
/// the [`Sendable`](https://developer.apple.com/documentation/swift/sendable)
/// protocol, the testing library calls its ``Attachable/withUnsafeBytes(for:_:)``
/// immediately and records a copy of the resulting buffer instead. If
/// `attachableValue` throws an error when the testing library calls its
/// ``Attachable/withUnsafeBytes(for:_:)`` function, the testing library
/// records that error as an issue in the current test.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
public static func record(_ attachment: consuming Self, sourceLocation: SourceLocation = #_sourceLocation) {
do {
let bufferCopy = try attachment.withUnsafeBytes { Array($0) }
Attachment<Array>.record(bufferCopy, sourceLocation: sourceLocation)
} catch {
let sourceContext = SourceContext(backtrace: .current(), sourceLocation: sourceLocation)
Issue(kind: .valueAttachmentFailed(error), severity: .warning, comments: [], sourceContext: sourceContext).record()
}
}
/// Attach a value to the current test.
///
/// - Parameters:
/// - attachableValue: The value to attach.
/// - preferredName: The preferred name of the attachment to use when saving
/// it. If `nil`, the testing library attempts to generate a reasonable
/// filename for the attached value.
/// - sourceLocation: The source location of the call to this function.
///
/// When `attachableValue` is an instance of a type that does not conform to
/// the [`Sendable`](https://developer.apple.com/documentation/swift/sendable)
/// protocol, the testing library calls its ``Attachable/withUnsafeBytes(for:_:)``
/// immediately and records a copy of the resulting buffer instead. If
/// `attachableValue` throws an error when the testing library calls its
/// ``Attachable/withUnsafeBytes(for:_:)`` function, the testing library
/// records that error as an issue in the current test.
///
/// This function creates a new instance of ``Attachment`` and immediately
/// attaches it to the current test.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
public static func record(_ attachableValue: consuming AttachableValue, named preferredName: String? = nil, sourceLocation: SourceLocation = #_sourceLocation) {
record(Self(attachableValue, named: preferredName, sourceLocation: sourceLocation), sourceLocation: sourceLocation)
}
}
// MARK: - Getting the serialized form of an attachable value (generically)
extension Attachment where AttachableValue: ~Copyable {
/// Call a function and pass a buffer representing the value of this
/// instance's ``attachableValue-2tnj5`` property to it.
///
/// - Parameters:
/// - body: A function to call. A temporary buffer containing a data
/// representation of this instance is passed to it.
///
/// - Returns: Whatever is returned by `body`.
///
/// - Throws: Whatever is thrown by `body`, or any error that prevented the
/// creation of the buffer.
///
/// The testing library uses this function when saving an attachment. This
/// function calls the ``Attachable/withUnsafeBytes(for:_:)`` function on this
/// attachment's ``attachableValue-2tnj5`` property.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.2)
/// @Available(Xcode, introduced: 26.0)
/// }
@inlinable public borrowing func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) throws -> R {
try attachableValue.withUnsafeBytes(for: self, body)
}
}
#if !SWT_NO_FILE_IO
// MARK: - Writing
extension Attachable where Self: ~Copyable {
#if !SWT_NO_FILE_CLONING
/// Clone the file this instance represents to the given file path if it
/// conforms to ``FileClonable``.
///
/// - Parameters:
/// - filePath: The path to clone this instance to.
///
/// - Returns: Whether or not the file was successfully cloned.
///
/// See ``FileClonable`` for more information.
fileprivate func clone(toFileAtPath filePath: String, for attachment: borrowing Attachment<Self>) -> Bool {
if #available(_castingWithNonCopyableGenerics, *),
let self = makeExistential(self) as? any FileClonable {
return self.clone(toFileAtPath: filePath)
}
return false
}
#endif
/// Write this instance to the given file system path.
///
/// - Parameters:
/// - filePath: The path to write to.
/// - attachment: The attachment that is requesting this instance be written
/// (that is, the attachment containing this instance.)
///
/// - Throws: Any error that prevented writing this instance to `filePath`.
///
/// The testing library uses this function when saving an attachment. The
/// default implementation opens `filePath` for writing with exclusive access,
/// then passes it to `_write(toFILE:for:)`.
borrowing func write(toFileAtPath filePath: String, for attachment: borrowing Attachment<Self>) throws {
#if !SWT_NO_FILE_CLONING
if clone(toFileAtPath: filePath, for: attachment) {
return
}
#endif
try withUnsafeBytes(for: attachment) { buffer in
// The underlying `fopen()` call should fail with `EEXIST` if a file
// exists at `filePath`.
let file = try FileHandle(atPath: filePath, options: [.writeAccess, .creationRequired])
try file.write(buffer)
}
}
}
extension Attachment where AttachableValue: ~Copyable {
/// Write the attachment's contents to a file in the specified directory.
///
/// - Parameters:
/// - directoryPath: The directory that should contain the attachment when
/// written.
///
/// - Throws: Any error preventing writing the attachment.
///
/// - Returns: The path to the file that was written.
///
/// The attachment is written to a file _within_ `directoryPath`, whose name
/// is derived from the value of the ``Attachment/preferredName`` property.
///
/// If you pass `--attachments-path` to `swift test`, the testing library
/// automatically uses this function to save attachments to the directory you
/// specify.
///
/// This function does not get or set the value of the attachment's
/// ``fileSystemPath`` property. The caller is responsible for setting the
/// value of this property if needed.
///
/// This function is provided as a convenience to allow tools authors to save
/// attachments the same way that Swift Package Manager does. You are not
/// required to use this function.
@_spi(ForToolsIntegrationOnly)
public borrowing func write(toFileInDirectoryAtPath directoryPath: String) throws -> String {
try write(
toFileInDirectoryAtPath: directoryPath,
appending: String(UInt64.random(in: 0 ..< .max), radix: 36)
)
}
/// Write the attachment's contents to a file in the specified directory.
///
/// - Parameters:
/// - directoryPath: The directory to which the attachment should be
/// written.
/// - usingPreferredName: Whether or not to use the attachment's preferred
/// name. If `false`, ``defaultPreferredName`` is used instead.
/// - suffix: A suffix to attach to the file name (instead of randomly
/// generating one.) This value may be evaluated multiple times.
///
/// - Throws: Any error preventing writing the attachment.
///
/// - Returns: The path to the file that was written.
///
/// The attachment is written to a file _within_ `directoryPath`, whose name
/// is derived from the value of the ``Attachment/preferredName`` property and
/// the value of `suffix`.
///
/// If the argument `suffix` always produces the same string, the result of
/// this function is undefined.
borrowing func write(toFileInDirectoryAtPath directoryPath: String, usingPreferredName: Bool = true, appending suffix: @autoclosure () -> String) throws -> String {
let result: String
let preferredName = usingPreferredName ? preferredName : Self.defaultPreferredName
do {
// First, attempt to create the file with the exact preferred name. If a
// file exists at this path, an error with code `EEXIST` will be thrown
// and we'll try again by adding a suffix.
let preferredPath = appendPathComponent(preferredName, to: directoryPath)
try attachableValue.write(toFileAtPath: preferredPath, for: self)
result = preferredPath
} catch {
// Split the extension(s) off the preferred name. The first component in
// the resulting array is our base name.
var preferredNameComponents = preferredName.split(separator: ".")
let firstPreferredNameComponent = preferredNameComponents[0]
while true {
preferredNameComponents[0] = "\(firstPreferredNameComponent)-\(suffix())"
let preferredName = preferredNameComponents.joined(separator: ".")
let preferredPath = appendPathComponent(preferredName, to: directoryPath)
// Propagate any error *except* EEXIST, which would indicate that the
// name was already in use (so we should try again with a new suffix.)
do {
try attachableValue.write(toFileAtPath: preferredPath, for: self)
result = preferredPath
break
} catch where error._code == swt_EEXIST() && error._domain == "NSPOSIXErrorDomain" {
// Try again with a new suffix.
continue
} catch where usingPreferredName {
// Try again with the default name before giving up.
return try write(toFileInDirectoryAtPath: directoryPath, usingPreferredName: false, appending: suffix())
}
}
}
return result
}
}
extension Runner {
/// Modify this runner's configured event handler so that it handles "value
/// attached" events and saves attachments where necessary.
mutating func configureAttachmentHandling() {
configuration.eventHandler = { [oldEventHandler = configuration.eventHandler] event, context in
var event = copy event
if case .valueAttached = event.kind {
guard let configuration = context.configuration,
configuration.handleValueAttachedEvent(&event, in: context) else {
// The attachment could not be handled, so suppress this event.
return
}
}
oldEventHandler(event, context)
}
}
}
extension Configuration {
/// Handle the given "value attached" event.
///
/// - Parameters:
/// - event: The event to handle. This event must be of kind
/// ``Event/Kind/valueAttached(_:)``. If the associated attachment's
/// ``Attachment/fileSystemPath`` property is not `nil`, this function
/// does nothing.
/// - context: The context associated with the event.
///
/// - Returns: Whether or not to continue handling the event.
///
/// This function is called automatically by ``handleEvent(_:in:)``. You do
/// not need to call it elsewhere. It automatically saves the attachment
/// associated with `event` and modifies `event` to include the path where the
/// attachment was saved.
fileprivate func handleValueAttachedEvent(_ event: inout Event, in eventContext: borrowing Event.Context) -> Bool {
guard let attachmentsPath else {
// If there is no path to which attachments should be written, there's
// nothing to do here. The event handler may still want to handle it.
return true
}
guard case let .valueAttached(attachment) = event.kind else {
preconditionFailure(reportBugMessage("Passed the wrong kind of event to \(#function) (expected valueAttached, got \(event.kind))."))
}
if attachment.fileSystemPath != nil {
// Somebody already saved this attachment. This isn't necessarily a logic
// error in the testing library, but it probably means we shouldn't save
// it again. Suppress the event.
return false
}
do {
// Write the attachment.
var attachment = attachment
attachment.fileSystemPath = try attachment.write(toFileInDirectoryAtPath: attachmentsPath)
// Update the event before returning and continuing to handle it.
event.kind = .valueAttached(attachment)
return true
} catch {
// Record the error as an issue and suppress the event.
let sourceContext = SourceContext(backtrace: .current(), sourceLocation: attachment.sourceLocation)
Issue(kind: .valueAttachmentFailed(error), severity: .warning, comments: [], sourceContext: sourceContext).record(configuration: self)
return false
}
}
}
#endif