-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestdevexp-warningIssues with the analyzer's Warning codesIssues with the analyzer's Warning codesimprove-diagnosticsRelated to the quality of diagnostic messagesRelated to the quality of diagnostic messageslegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Consider the following library:
// Library 'n010lib.dart'.
typedef E<X> = _E<X>;
extension type _E<X>._(X x) {
_E.named(X x) : this._(x);
}
This library gives rise to the following diagnostic when processed by the analyzer (6672353):
Analyzing n010lib.dart... 0.4s
info • n010lib.dart:6:6 • The declaration '_E.named' isn't
referenced. Try removing the declaration of '_E.named'. •
unused_element
1 issue found.
However, it isn't true that _E.named
is known to be unused. For example, we can use it from a library n010.dart
with the following contents:
// Library 'n010.dart'.
import 'n010lib.dart';
void main() {
E<int>.named(1);
}
The point is that _E
should not be considered to be a private type when it has been made reachable via a type alias.
srawlins, albertms10, kevmoo and Juliotati
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestdevexp-warningIssues with the analyzer's Warning codesIssues with the analyzer's Warning codesimprove-diagnosticsRelated to the quality of diagnostic messagesRelated to the quality of diagnostic messageslegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)