Coerce phantom types

How I would imagine doing this is either:

extension Blah {
  @inlinable
  init<U>(_ other: Blah<U> { /* assign properties */}
}

Or the following if you want to restrict the source / destination types:

extension Blah where /* insert constraints here */ {
  @inlinable
  init(_ other: Blah<Int> { /* assign properties */} // Int as example
}

Basically, treat it as any other initializer and trust the compiler to remove the copies.

1 Like