The code below produces no issues in the analyzer but an error in CFE.
class C<T> {
T t;
C(this.t);
}
main() {
C<void> c1 = C<void>(1);
C<void>? c2 = (2 > 1) ? C<void>(2) : null;
print(c1.t as int); // prints 1
print(c2?.t as int); // Error: This expression has type 'void' and can't be used.
}
The code below produces no issues in the analyzer but an error in CFE.
Accoding to the spec
There should be no such error in the CFE.
`Dart SDK version: 3.7.0-edge.a0c4efddb8ada994c3f8568268478a4948bc32b7 (main) (Tue Nov 12 08:16:42 2024 +0000) on "linux_x64"