-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
NNBDIssues related to NNBD ReleaseIssues related to NNBD ReleaseP1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failuresarea-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.type-taskA well-defined stand-alone taskA well-defined stand-alone task
Description
The current published core packages don't work with sound null safety in Dart 2.12:
- They use upper constraints like
<2.12.0which causes confusing pub warnings - They use lower constraints like
>=2.10.0-78, which pub interprets as not opted into null safety
Repro steps:
-
Update to latest Dart/Flutter master SDK
-
dart create repro -
cd repro -
Update
pubspec.yamlto have SDK constraint:sdk: '>=2.12.0-0.0 <3.0.0' -
Update
pubspec.yamlto not have a dependency onpedantic -
dart pub get -
dart --sound-null-safety run=> Runs as expected -
Edit
pubspec.yamland add a dependency:dependencies: collection: ^1.15.0-nullsafety -
dart pub get
Issue 1: Upper bound warning
pub get prints:
Resolving dependencies... (1.1s)
Overriding the upper bound Dart SDK constraint to <=2.12.0-3.0.dev for the following packages:
collection
To disable this you can set the PUB_ALLOW_PRERELEASE_SDK system environment variable to `false`, or you can silence this message by setting it to `quiet`.
> collection 1.15.0-nullsafety.4 (was 1.14.13)
issue 2: Sound null safety is disabled:
pub get prints:
The package resolution is not fully migrated to null-safety.
package:collection is not opted into null safety in its pubspec.yaml:
╷
8 │ sdk: '>=2.10.0-78 <2.12.0'
│ ^^^^^^^^^^^^^^^^^^^^^
╵
Either downgrade your sdk constraint, or invoke dart/flutter with
`--no-sound-null-safety`.
tvolkert
Metadata
Metadata
Assignees
Labels
NNBDIssues related to NNBD ReleaseIssues related to NNBD ReleaseP1A high priority bug; for example, a single project is unusable or has many test failuresA high priority bug; for example, a single project is unusable or has many test failuresarea-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.type-taskA well-defined stand-alone taskA well-defined stand-alone task