[vm/ffi] Deprecate Pointer.cast()
?
#56214
Labels
area-native-interop
Used for native interop related issues, including FFI.
library-ffi
P3
A lower priority bug or feature request
Now that we no longer reify the type arguments of
Pointer
we should consider whether
.cast()
can be replaced by simplyas
checks.Currently, the runtime still have a type arguments vector at runtime
Pointer
#50777So if we use a normal cast, we could accidentally introduce runtime type checks if the compiler can't figure out that pointers are always instantiated with
Never
as type argument.Conceptually speaking
Pointer<T>
should maybe be an extension type onPointerNever
(now that we stopped reifying the type argument). But, we've introducedPointer
s before extension types were added to Dart. Its probably not possible to now changePointer
to an extension type. 😄Thanks @HosseinYousefi for the suggestion!
The text was updated successfully, but these errors were encountered: