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

members of @doNotStore tagged libraries are not reliably inheriting the annotation #43692

Open
pq opened this issue Oct 6, 2020 · 4 comments
Assignees
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. customer-google3 P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@pq
Copy link
Member

pq commented Oct 6, 2020

In some tests internally, the following pattern is not reliably working:

strings.dart:

@doNotStore
library strings;

import 'package:meta/meta.dart';

String get someString => 'string';

c.dart:

import 'strings.dart' as strings;

class C {
   String title(Object o) => strings.someString; //<= should show warning
}
@pq pq added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-warning Issues with the analyzer's Warning codes customer-google3 labels Oct 6, 2020
@pq pq self-assigned this Oct 6, 2020
@bwilkerson
Copy link
Member

What is the intended semantics of applying the annotation to an entire library? According to the documentation (which might need to be updated):

The annotation can also be applied to a class to implicitly annotate all of the valid members of the class, or applied to a library to annotate all of the valid members of the library, including classes.

That implies, to me, that applying the annotation to the library implicitly applies it to the class C, which implicitly applies it to the method C.title, so it seems like it ought to be valid to return the value of the getter.

@pq
Copy link
Member Author

pq commented Oct 6, 2020

applying the annotation to the library implicitly applies it to the class C

Sorry, I think my example wasn't clear. C is in a different library from strings. (I'll add some details.)

@pq
Copy link
Member Author

pq commented Oct 6, 2020

Unless I'm misunderstanding the desired semantics, I'd expect to see a warning on C.title above.

@bwilkerson
Copy link
Member

Me too, given that they're in different libraries.

@srawlins srawlins added the P3 A lower priority bug or feature request label Nov 10, 2020
@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. customer-google3 P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants