Skip to content

Commit 7cec902

Browse files
stereotype441commit-bot@chromium.org
authored andcommitted
[VM,libs] Add workaround for issue 31305.
The tear-off of _NativeSocket.multiplex needs to have runtime type `(Object) -> void` in order to be passed to the RawReceivePort constructor. Once issue #31305 is fixed, we should be able to fix this by marking _NativeSocket.multiplex's argument as "covariant". Until then, we have to type the argument as `Object` and then assign it. Change-Id: I1c9b7fb77dd3b0a71037459206f8de30ad77f73e Reviewed-on: https://dart-review.googlesource.com/20822 Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent f280058 commit 7cec902

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runtime/bin/socket_patch.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,10 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
811811
}
812812

813813
// Multiplexes socket events to the socket handlers.
814-
void multiplex(int events) {
814+
void multiplex(Object eventsObj) {
815+
// TODO(paulberry): when issue #31305 is fixed, we should be able to simply
816+
// declare `events` as a `covariant int` parameter.
817+
int events = eventsObj;
815818
for (int i = FIRST_EVENT; i <= LAST_EVENT; i++) {
816819
if (((events & (1 << i)) != 0)) {
817820
if ((i == CLOSED_EVENT || i == READ_EVENT) && isClosedRead) continue;

0 commit comments

Comments
 (0)