New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UntypedPointer
as a superclass of Pointer
#10749
base: master
Are you sure you want to change the base?
Conversation
This looks great. Limiting the interface of a void pointer is a good idea. This is a step towards removing As for the time table, I assume we can merge this (as soon as it's ironed out), then deprecate As a tiny detail, I'd prefer a namespaced name: |
Thanks for this! A couple of comments:
|
Please, let's not continue names that are semantically wrong. |
@asterite The advantage is that it allows us to get rid of |
This is a proof-of-concept implementation for #10657 (comment).
UntypedPointer
has no support for pointer arithmetic at all and cannot be dereferenced; other than that, it has the same semantics asPointer(Void)
, and the two types should be interchangeable.Pointer
is unique in that the union of aPointer(T)
instance with anotherPointer(U)
orUntypedPointer
does not merge intoUntypedPointer
.Code that uses
Pointer(Void)
shall continue to work for the rest of 1.x; this PR does not applyUntypedPointer
to the standard library yet, because it is a primitive type and the 1.0 compiler has no knowledge of its existence.