Skip to content

UnmodifiableListView extends class that is not part of Dart API #1481

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 Aug 11, 2017 · 3 comments
Closed

UnmodifiableListView extends class that is not part of Dart API #1481

floitschG opened this issue Aug 11, 2017 · 3 comments
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@floitschG
Copy link

From @sgrekhov on June 21, 2016 10:45

Please see https://api.dartlang.org/stable/1.16.0/dart-collection/UnmodifiableListView-class.html

Inheritance Object ListBase UnmodifiableListBase UnmodifiableListView

But UnmodifiableListBase is not part of the Dart API. This has several consequences
First, I think, UnmodifiableListBase shold be made internal _UnmodifiableListBase
Second, it shouldn't be shown in documentation. Otherwise documentation became wrong. For example, it shows operator []= as inherited (it is really inherited from UnmodifiableListBase, but documentation shows operator []= as inherited from ListBase (because UnmodifiableListBase is not part of the API and has no documentation)). But operator []= in ListBase sets the value while operator []= in UnmodifiableListView throws UnsupportedError

Documentation issue regarding showing of internal interfaces is #1173

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

@floitschG
Copy link
Author

From @lrhn on June 22, 2016 11:13

This is similar to issue #26643 in that it exposes an interface from dart:_internal.

We can't make UnmodifiableListBase private because it's from a different library (dart:_internal).
We can either find a way to hide it from the DartDoc, move the class to dart:collection and make it private, or move it and keep it public.
The first option is still open (as an issue against the dartdoc tool), the second one is likely to fail because UnmodifiableListBase is also used in libraries other than dart:collection, so the third option looks better and better.

@jcollins-g
Copy link
Contributor

jcollins-g commented Sep 12, 2017

The @nodoc directive (place that in a comment for the class) in dartdoc should permit you to hide a class from being documented. However, the reason dartdoc thinks it is public is that it believes the symbol is exported from dart:collection. That looks like a real bug.

@jcollins-g jcollins-g added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P1 A high priority bug; for example, a single project is unusable or has many test failures labels Sep 12, 2017
@jcollins-g
Copy link
Contributor

This bug is actually now just a straight duplicate of #1173. The more serious elements of this were fixed in #1390 and related canonicalization fixes.

Compare current documentation: https://api.dartlang.org/dev/2.0.0-dev.2.0/dart-collection/UnmodifiableListView-class.html to the version first cited in the bug. We still show operator[]= as inherited. That's #1173. However, the critical nature of this bug was that we were claiming it was inherited from ListBase. That's no longer the case. We actually just document this operator as inherited, without specifying anywhere else but UnmodifiableListView as where it comes from.

Fixing #1173 would mean lying about the inheritance status here if we inherit from a non-canonical class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants