static Pointer<Void> toPointer(Error? val) { if (val == null) { return nullptr; } final result = malloc<ErrorNative>(); result.ref = ErrorImpl.toNative(val); return result.cast(); }