[swift-users] UnsafeMutablePointer: Ambiguous use of init (but not always)

nyg nyg nygmlist at gmail.com
Mon Sep 25 14:47:03 CDT 2017


Hello all,

Considering the following code:

var n = 42
let ptr1 = UnsafeMutablePointer<Int>(&n)
let ptr2: UnsafeMutablePointer<Int> = UnsafeMutablePointer.init(&n)
let ptr3 = UnsafeMutablePointer<Int>.init(&n)

I get "Ambiguous use of init" for ptr3. There are no issues with ptr1
and ptr2. Is this a bug or am I missing something? :D

Thanks!
Nick


More information about the swift-users mailing list