mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:21:07 +00:00
a980fb1849
Fix all warnings/errors when running with --enable-experiment=non-nullable flag Change-Id: I7673aa34466273d623f7a429d96b0ccd6b612dae Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139980 Commit-Queue: Siva Annamalai <asiva@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>
35 lines
970 B
Dart
35 lines
970 B
Dart
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'dart:async';
|
|
import 'dart:isolate';
|
|
import 'dart:typed_data';
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
double getDoubleWithHeapObjectTag() {
|
|
final bd = ByteData(8);
|
|
bd.setUint64(0, 0x8000000000000001, Endian.host);
|
|
final double v = bd.getFloat64(0, Endian.host);
|
|
return v;
|
|
}
|
|
|
|
class Foo {
|
|
final double x = getDoubleWithHeapObjectTag();
|
|
final String name = "Foo Class";
|
|
Foo();
|
|
}
|
|
|
|
main(args) async {
|
|
final receivePort = new ReceivePort();
|
|
|
|
receivePort.sendPort.send(Foo());
|
|
final it = StreamIterator(receivePort);
|
|
Expect.isTrue(await it.moveNext());
|
|
final Foo receivedFoo = it.current as Foo;
|
|
Expect.equals(receivedFoo.x, getDoubleWithHeapObjectTag());
|
|
Expect.equals(receivedFoo.name, "Foo Class");
|
|
await it.cancel();
|
|
}
|