Skip to content

dart:io APPEND field should be marked as const in Dart API Spec #1576

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

Closed
floitschG opened this issue Dec 22, 2017 · 3 comments · Fixed by #1585
Closed

dart:io APPEND field should be marked as const in Dart API Spec #1576

floitschG opened this issue Dec 22, 2017 · 3 comments · Fixed by #1585
Assignees
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@floitschG
Copy link

From @iarkh on December 20, 2017 4:30

dart:io APPEND Spec reads:

APPEND = FileMode.APPEND
The mode for opening a file for reading and writing to the end of it. The file is created if it does not already exist.

It should be marked as const because actually it's a constant and cannot be changed.
So, description should look loke one for FileMode.APPEND field:
dynamic APPEND = **const** FileMode._internal(2)
See here: https://api.dartlang.org/stable/1.24.3/dart-io/APPEND-constant.html

Some other fields from dart:io Constants section in the Spec are also not marked const: READ, WRITE, WRITE_ONLY, WRITE_ONLY_APPEND.

Copied from original issue: dart-lang/sdk#31697

@floitschG
Copy link
Author

Marking as a dartdoc issue.
The constant itself is const.

const APPEND = FileMode.APPEND;

The const in front of it makes the variable constant.
However, dartdoc doesn't show this in the documentation.

@jcollins-g
Copy link
Contributor

jcollins-g commented Dec 22, 2017

This is a little more clear at head with the navigation improvements since const shows before the name in navigation now, but still does not display "const" before the variable name in the signature. It should.

@jcollins-g jcollins-g added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P2 A bug or feature request we're likely to work on labels Dec 22, 2017
@jcollins-g jcollins-g self-assigned this Jan 8, 2018
@jcollins-g
Copy link
Contributor

PR #1585 has some screenshots now for a proposed resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
2 participants