File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -384,6 +384,18 @@ extension on Element {
384384 ) when variable3.isInAnalyzerPublicApi) {
385385 return true ;
386386 }
387+ if (this case PropertyInducingElement (
388+ isSynthetic: true ,
389+ : var getter2? ,
390+ ) when getter2.isInAnalyzerPublicApi) {
391+ return true ;
392+ }
393+ if (this case PropertyInducingElement (
394+ isSynthetic: true ,
395+ : var setter2? ,
396+ ) when setter2.isInAnalyzerPublicApi) {
397+ return true ;
398+ }
387399 if (this case Annotatable (
388400 metadata: Metadata (: var annotations),
389401 ) when annotations.any (_isPublicApiAnnotation)) {
Original file line number Diff line number Diff line change @@ -2187,6 +2187,42 @@ export 'src/file2.dart';
21872187 await assertNoDiagnosticsInFile (libFile);
21882188 }
21892189
2190+ test_exportsNonPublicName_ignoredIfAnnotatedPublic_getter () async {
2191+ newFile (libSrcFile, '''
2192+ class AnalyzerPublicApi {
2193+ const AnalyzerPublicApi();
2194+ }
2195+ ''' );
2196+ newFile (libSrcFile2, '''
2197+ import 'file.dart';
2198+
2199+ @AnalyzerPublicApi()
2200+ int get x => 7;
2201+ ''' );
2202+ newFile (libFile, '''
2203+ export 'src/file2.dart';
2204+ ''' );
2205+ await assertNoDiagnosticsInFile (libFile);
2206+ }
2207+
2208+ test_exportsNonPublicName_ignoredIfAnnotatedPublic_setter () async {
2209+ newFile (libSrcFile, '''
2210+ class AnalyzerPublicApi {
2211+ const AnalyzerPublicApi();
2212+ }
2213+ ''' );
2214+ newFile (libSrcFile2, '''
2215+ import 'file.dart';
2216+
2217+ @AnalyzerPublicApi()
2218+ set x(int value) {}
2219+ ''' );
2220+ newFile (libFile, '''
2221+ export 'src/file2.dart';
2222+ ''' );
2223+ await assertNoDiagnosticsInFile (libFile);
2224+ }
2225+
21902226 test_exportsNonPublicName_ignoredIfHidden () async {
21912227 newFile (libSrcFile, '''
21922228class B {}
You can’t perform that action at this time.
0 commit comments