Skip to content

Commit e8fda1e

Browse files
author
Dart CI
committed
Version 3.9.0-236.0.dev
Merge 3616986 into dev
2 parents ae721d7 + 3616986 commit e8fda1e

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

pkg/linter/lib/src/rules/analyzer_public_api.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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)) {

pkg/linter/test/rules/analyzer_public_api_test.dart

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff 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, '''
21922228
class B {}

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ CHANNEL dev
2727
MAJOR 3
2828
MINOR 9
2929
PATCH 0
30-
PRERELEASE 235
30+
PRERELEASE 236
3131
PRERELEASE_PATCH 0

0 commit comments

Comments
 (0)