Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify that the pubspec version determines the Dart language version #5360

Closed
MaryaBelanger opened this issue Nov 17, 2023 · 0 comments · Fixed by #5385
Closed

Verify that the pubspec version determines the Dart language version #5360

MaryaBelanger opened this issue Nov 17, 2023 · 0 comments · Fixed by #5385
Assignees
Labels
a.language Relates to the Dart language tour e1-hours Can complete in < 8 hours of normal, not dedicated, work from.page-issue Reported in a reader-filed concern p2-medium Necessary but not urgent concern. Resolve when possible. t.diagnostics Relates to diagnostics, analysis, or linting of code

Comments

@MaryaBelanger
Copy link
Contributor

MaryaBelanger commented Nov 17, 2023

Page URL

https://dart.dev/tools/non-promotion-reasons

Page source

https://github.com/dart-lang/site-www/blob/main/src/tools/non-promotion-reasons.md

Describe the problem

I know I wrote it, but is this statement actually correct?

Solution:

Ensure your code isn’t targeting a previous language version of Dart. Check the top of your file for a //@Dart=version comment, or the version field of your pubspec.yaml.

Asking because I just got the same error while working on updating code excerpts, so I went to check the pubspec.yaml and there isn't a version field anywhere in it: https://github.com/dart-lang/site-www/blob/promo-code-exc/examples/non_promotion/pubspec.yaml

name: non_promotion_examples
description: dart.dev non-promotion examples.
version: 0.0.1

environment:
  sdk: ^3.2.0

dev_dependencies:
  lints: ^3.0.0

I don't know where I got the idea to write that in...

@MaryaBelanger MaryaBelanger added the from.page-issue Reported in a reader-filed concern label Nov 17, 2023
@parlough parlough added a.language Relates to the Dart language tour t.diagnostics Relates to diagnostics, analysis, or linting of code p2-medium Necessary but not urgent concern. Resolve when possible. e1-hours Can complete in < 8 hours of normal, not dedicated, work labels Nov 20, 2023
@atsansone atsansone changed the title "version field of pubspec.yaml" to fix field promotion failure? Verify that the pubspec version determines the Dart language version Nov 27, 2023
@parlough parlough assigned parlough and unassigned stereotype441 Dec 1, 2023
parlough added a commit that referenced this issue Dec 1, 2023
I'm not sure about the writing of this, so please feel free to make
adjustments, but you're right, there is no `version` field. The
package-wide default language version comes from the lower bound of the
[SDK constraint](https://dart.dev/tools/pub/pubspec#sdk-constraints) you
declare in your `pubspec.yaml` file.

Fixes #5360

---------

Co-authored-by: Marya <111139605+MaryaBelanger@users.noreply.github.com>
atsansone pushed a commit to atsansone/site-www that referenced this issue Jan 26, 2024
I'm not sure about the writing of this, so please feel free to make
adjustments, but you're right, there is no `version` field. The
package-wide default language version comes from the lower bound of the
[SDK constraint](https://dart.dev/tools/pub/pubspec#sdk-constraints) you
declare in your `pubspec.yaml` file.

Fixes dart-lang#5360

---------

Co-authored-by: Marya <111139605+MaryaBelanger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.language Relates to the Dart language tour e1-hours Can complete in < 8 hours of normal, not dedicated, work from.page-issue Reported in a reader-filed concern p2-medium Necessary but not urgent concern. Resolve when possible. t.diagnostics Relates to diagnostics, analysis, or linting of code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants