-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
NNBDIssues related to NNBD ReleaseIssues related to NNBD Releasearea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Description
Dart VM version: 2.8.0-edge.aadcb4418b1a7ccbb74a7cc925ad55020ce4a924 (Thu Feb 6 02:00:49 2020 +0000) on "linux_x64"
NNBD Spec reads:
The NNBD_TOP_MERGE of two types T and S is the unique type R defined as:
NNBD_TOP_MERGE(Object?, dynamic) = Object?
And the reverse
Please run the following source code example:
class A<T> {
void test() { print(T); }
}
class B extends A<Object?> {}
class C extends A<dynamic> {}
class D1 extends B implements C {}
class D2 extends C implements B {}
void main() {
D1().test();
D2().test();
}
Dart prints:
$ dart --enable-experiment=non-nullable test.dart
Object
dynam
Seems like both D1().test();
and D2().test();
should print Object
here.
The same is true for NNBD_TOP_MERGE(Object?, void)
.
Metadata
Metadata
Assignees
Labels
NNBDIssues related to NNBD ReleaseIssues related to NNBD Releasearea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.