Documentation question for UnsafeMutablePointer

Why do we declare in the document comments of the initialization method of the UnsafeMutablePointer type that it "Create an immutable typed pointer"?

I am a little confused by the doc statement here.

Could you help check with it and maybe give some explanation here? Thanks @Alex_Martini

2 Likes

I'm not sure — the work I've done on "unsafe' docs was cleaning up some trailing whitespace and other minor wording fixes. It's possible this is just a copy/paste error from UnsafePointer to UnsafeMutablePointer.

Looking at Git blame, maybe @nnnnnnnn or @hamishknight can help with this? But it's probably not in anybody's recent memory, since changes to these docs and APIs are from 4 and 7 years ago.

3 Likes

Yeah, I'm pretty sure this is just an error.

1 Like

For folks following along, Kyle Ye's PR that fixes this copy/paste error was merged:

https://github.com/apple/swift/pull/69297

Thanks!

3 Likes