Значение типа 'OpaquePointer' не имеет члена 'pointee' - PullRequest
0 голосов
/ 15 апреля 2020

Я пытаюсь скомпилировать yenom / BitcoinKit из GitHub. Проблема в BitcoinKit.Private.swift.

Ошибка "Значение типа 'OpaquePointer' не имеет члена 'pointee'".

Код, который его вызывает (оставляя в комментариях часть):

let privateKeyNum = BN_new()!

// other stuff in the file

// Check for invalid derivation.
//if BN_is_zero(privateKeyNum) {
//    return nil
//}
if privateKeyNum.pointee.top == 0 { // BN_is_zero
    return nil
}

Теперь, глядя на COpenSSL для BN_new:

public func BN_new() -> OpaquePointer!

И, наконец, в Swift, C, OpaquePointer:

/// A wrapper around an opaque C pointer.
///
/// Opaque pointers are used to represent C pointers to types that
/// cannot be represented in Swift, such as incomplete struct types.
@frozen public struct OpaquePointer {

    /// Creates an `OpaquePointer` from a given address in memory.
    public init?(bitPattern: Int)

    /// Creates an `OpaquePointer` from a given address in memory.
    public init?(bitPattern: UInt)

    /// Converts a typed `UnsafePointer` to an opaque C pointer.
    public init<T>(_ from: UnsafePointer<T>)

    /// Converts a typed `UnsafePointer` to an opaque C pointer.
    ///
    /// The result is `nil` if `from` is `nil`.
    public init?<T>(_ from: UnsafePointer<T>?)

    /// Converts a typed `UnsafeMutablePointer` to an opaque C pointer.
    public init<T>(_ from: UnsafeMutablePointer<T>)

    /// Converts a typed `UnsafeMutablePointer` to an opaque C pointer.
    ///
    /// The result is `nil` if `from` is `nil`.
    public init?<T>(_ from: UnsafeMutablePointer<T>?)

    public init(_ from: UnsafeMutableRawPointer)

    public init?(_ from: UnsafeMutableRawPointer?)

    public init(_ from: UnsafeRawPointer)

    public init?(_ from: UnsafeRawPointer?)

    public static func != (lhs: OpaquePointer, rhs: OpaquePointer) -> Bool
}
...