Closed komuw closed 4 years ago
This appears similar to https://github.com/dart-lang/test/issues/1255 ; which seems to have been fixed??
this works though;
export DART_VM_OPTIONS='--enable-experiment=non-nullable, --no-null-safety' && \
pub run test .
https://github.com/dart-lang/sdk/issues/42465.
https://github.com/dart-lang/sdk/issues/41853
https://github.com/dart-lang/pub/pull/2542.
These errors A library can't opt out of non-nullable by default, when in nnbd-strong mode.
are related to the missing --no-sound-null-safety
flag in pub.
The top two warnings are concerning though, I wouldn't expect to see those, cc @leafpetersen can you help explain what is happening here, should we be filing an issue on the CFE? These are not opted in libraries:
../../.pub-cache/hosted/pub.dartlang.org/test_api-0.2.17/lib/src/backend/stack_trace_formatter.dart:65:17: Warning: Operand of null-aware operation '?.' has type 'Invoker' which excludes null.
- 'Invoker' is from 'package:test_api/src/backend/invoker.dart' ('../../.pub-cache/hosted/pub.dartlang.org/test_api-0.2.17/lib/src/backend/invoker.dart').
Invoker.current?.liveTest?.test?.metadata?.verboseTrace ?? false;
../../.pub-cache/hosted/pub.dartlang.org/package_config-1.9.3/lib/src/package_config_json.dart:254:17: Warning: Operand of null-aware operation '...?' has type 'Map<String, dynamic>' which excludes null.
- 'Map' is from 'dart:core'.
...?_extractExtraData(package.extraData, _packageNames),
@jakemac53 I believe the first two errors are spurious errors caused by the second. I believe that because the code is being run in strong mode, the CFE is compiling the code in as if it were all opted in before or concurrently with noticing that the library is not opted in.
Filed an issue here.
Ok I am going to close this issue then.
Is there an issue filed somewhere on pub about the missing --no-sound-null-safety
flag? @jonasfj
with this program;
main.dart
pub fails;
pub run --enable-experiment=non-nullable test main.dart
pub --version
dart --version
cat pubspec.yaml