# Compilation Error with Sendable

**URL:** <https://forums.swift.org/t/compilation-error-with-sendable/56187>\
**Category:** Using Swift\
**Tags:** concurrency, compiler-warning, sendable\
**Created:** [March 23, 2022, 7:14pm UTC](https://forums.swift.org/t/compilation-error-with-sendable/56187 "2022-03-23T19:14:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitriy\_Ignatyev](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dmitriy_ignatyev/32/11340_2.png) [@Dmitriy\_Ignatyev](https://forums.swift.org/u/Dmitriy_Ignatyev)\
**Post date:** [March 23, 2022, 7:14pm UTC](https://forums.swift.org/t/compilation-error-with-sendable/56187/1 "2022-03-23T19:14:04Z")

</div>

Hi everyone.

I have a simple type alias: `public typealias SendableCustomStringConvertible = Sendable & CustomStringConvertible`

Trying to compile framework, I get a compiler error:  
Undefined symbols for architecture x86\_64:  
"protocol descriptor for Swift.Sendable", referenced from:  
type metadata accessor for Swift.CustomStringConvertible & Swift.Sendable in BaseError.o  
ld: symbol(s) not found for architecture x86\_64  
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The problem is that this error is not reproducable in another project. What are the possible reasons? What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Jumhyn](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jumhyn/32/3891_2.png) [@Jumhyn](https://forums.swift.org/u/Jumhyn)\
**Post date:** [March 23, 2022, 7:23pm UTC](https://forums.swift.org/t/compilation-error-with-sendable/56187/2 "2022-03-23T19:23:39Z")

</div>

Is that typealias _used_ anywhere in the project, or does the definition alone seem to break linking?

---

<div class="post-metadata">

**Author:** ![Dmitriy\_Ignatyev](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dmitriy_ignatyev/32/11340_2.png) [@Dmitriy\_Ignatyev](https://forums.swift.org/u/Dmitriy_Ignatyev)\
**Post date:** [March 23, 2022, 8:38pm UTC](https://forums.swift.org/t/compilation-error-with-sendable/56187/3 "2022-03-23T20:38:18Z")

</div>

The alone definition leads to this error. One more interesting thing, the next lines of code don't lead to error:

```swift
extension OrderedDictionary: @unchecked Sendable where Key: Sendable, Value: Sendable {}
extension OrderedSet: @unchecked Sendable where Element: Sendable {}

extension NonEmpty: @unchecked Sendable where RawValue: Sendable {}

extension URL: @unchecked Sendable {}

```

The problem for now is only with typealis. But error occurs in another file. What I mean is typealias is defined in file A, and error occurs in file B.  
If I replace typealias with direct protocol composition of `Sendable & CustomStringConvertible`, the error still occurs, only in file B and only inside this particular framework.

Some more details:

- it is a dynamic framework
- framework imports only one system library: Foundation
- 3 libraries are added via SPM: SwiftCollections, NonEmpty, SwiftURL

The simplified code in file B is:

```swift
public protocol BaseError: LocalizedError, CustomStringConvertible, CustomDebugStringConvertible {
  var code: Int { get }
  
  var domain: String { get }
  
  var domainShortCode: String { get }
  
  var underlying: BaseError? { get }
  
  var userInfo: [String: any SendableCustomStringConvertible] { get }
}

```

---

<div class="post-metadata">

**Author:** ![Dmitriy\_Ignatyev](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dmitriy_ignatyev/32/11340_2.png) [@Dmitriy\_Ignatyev](https://forums.swift.org/u/Dmitriy_Ignatyev)\
**Post date:** [March 23, 2022, 8:42pm UTC](https://forums.swift.org/t/compilation-error-with-sendable/56187/4 "2022-03-23T20:42:07Z")

</div>

Just while writing the message above I've got an idea: the minimal deploy target is iOS 12. So, I bumped it to iOS 13 and error has disappeared.  
Thanks for response 🙏

---

<div class="post-metadata">

**Author:** ![Jumhyn](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jumhyn/32/3891_2.png) [@Jumhyn](https://forums.swift.org/u/Jumhyn)\
**Post date:** [March 23, 2022, 9:19pm UTC](https://forums.swift.org/t/compilation-error-with-sendable/56187/5 "2022-03-23T21:19:06Z")

</div>

Glad you figured it out! Still, I was under the impression that as a marker protocol, `Sendable` was meant to have no ABI impact, so I’m a bit confused why it would be showing up in linker errors… 🤔

(And, regardless, it seems like availability checking should have thrown this out with a reasonable error messages as opposed to a linking failure)
