dart-lang / yaml_edit

A library for YAML manipulation with comment and whitespace preservation.
https://pub.dev/packages/yaml_edit
BSD 3-Clause "New" or "Revised" License
27 stars 16 forks source link

updates for the next version of package:yaml #45

Closed devoncarew closed 1 year ago

devoncarew commented 1 year ago

A newer (unreleased) version of package:yaml adds a bit more type info to it's API; this change lets yaml_edit work with either the current (dynamic) version of the API, or the new (Object?) version of the API.

https://github.com/dart-lang/yaml/commit/1ad2f49ecbea03460b87ea28709f5ed0213077b0#r103444673

cc @kevmoo @jonasfj

devoncarew commented 1 year ago

For context:

  error • lib/src/strings.dart:142:37 • The argument type 'Object?' can't be assigned to the parameter type 'String'. •
          argument_type_not_assignable
           - 'value' refers to a property so it couldn't be promoted.  See http://dart.dev/go/non-promo-property at lib/src/strings.dart:162:74.
  error • lib/src/strings.dart:144:40 • The argument type 'Object?' can't be assigned to the parameter type 'String'. •
          argument_type_not_assignable
           - 'value' refers to a property so it couldn't be promoted.  See http://dart.dev/go/non-promo-property at lib/src/strings.dart:162:74.
...

We see similar errors from the CFE as well.

jonasfj commented 1 year ago

@devoncarew will we need changes in: https://github.com/dart-lang/yaml_edit/blob/48e5868b307b2a3619fc9aaf3e70c0c637c91b7e/lib/src/wrap.dart#L82-L98

devoncarew commented 1 year ago

@devoncarew will we need changes in:

https://github.com/dart-lang/yaml_edit/blob/48e5868b307b2a3619fc9aaf3e70c0c637c91b7e/lib/src/wrap.dart#L82-L98

Hmm, I saw no analysis issues there (before or after), but we should probably update:

@override
final dynamic value;

to final Object? value; once the next version of yaml is published.

github-actions[bot] commented 1 year ago

Package publishing

Package Version Status Publish tag
package:yaml_edit 2.1.1 ready to publish (merge and tag to publish) v2.1.1

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.