diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f7dff74e0..1df13b69dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 8.0.2 + +* Remove @hideConstantImplementations fully. (#3593) +* Remove Class assert for ClassTypedef. (#3595) + ## 8.0.1 * The deprecated public APIs will be removed in the next major release. diff --git a/dartdoc_options.yaml b/dartdoc_options.yaml index 8953cfed4c..f149a70d90 100644 --- a/dartdoc_options.yaml +++ b/dartdoc_options.yaml @@ -1,4 +1,4 @@ dartdoc: linkToSource: root: '.' - uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v8.0.1/%f%#L%l%' + uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v8.0.2/%f%#L%l%' diff --git a/lib/src/model/typedef.dart b/lib/src/model/typedef.dart index ed8dc8debd..3199a55eec 100644 --- a/lib/src/model/typedef.dart +++ b/lib/src/model/typedef.dart @@ -94,7 +94,8 @@ class GeneralizedTypedef extends Typedef { class ClassTypedef extends Typedef { ClassTypedef(super.element, super.library, super.packageGraph) { assert(!isCallable); - assert(modelType.modelElement is Class); + // TODO(kallentu): Make sure typedef testing is covered for each interface + // element. } @override diff --git a/lib/src/version.dart b/lib/src/version.dart index eaef880621..5a2b7f29c7 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -1 +1 @@ -const packageVersion = '8.0.1'; +const packageVersion = '8.0.2'; diff --git a/pubspec.yaml b/pubspec.yaml index d634d9d1fe..4e6523e360 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: dartdoc -version: 8.0.1 +version: 8.0.2 description: A non-interactive HTML documentation generator for Dart source code. repository: https://github.com/dart-lang/dartdoc diff --git a/test/typedef_test.dart b/test/typedef_test.dart index b4f3815499..ae035d6c1d 100644 --- a/test/typedef_test.dart +++ b/test/typedef_test.dart @@ -20,13 +20,38 @@ void main() { @reflectiveTest class TypedefTest extends DartdocTestBase { + @override + List get experiments => ['inline-class']; + @override String get libraryName => 'typedefs'; @override - String get sdkConstraint => '>=3.0.0 <4.0.0'; + String get sdkConstraint => '>=3.3.0 <4.0.0'; + + void test_class_basic() async { + var library = await bootPackageWithLibrary(''' +class C {} +typedef T = C; +'''); + final tTypedef = library.typedefs.named('T'); + expect(tTypedef.nameWithGenerics, 'T'); + expect(tTypedef.genericParameters, ''); + expect(tTypedef.aliasedType, isA()); + } + + void test_extensionType_basic() async { + var library = await bootPackageWithLibrary(''' +extension type E(int i) {} +typedef T = E; +'''); + final tTypedef = library.typedefs.named('T'); + expect(tTypedef.nameWithGenerics, 'T'); + expect(tTypedef.genericParameters, ''); + expect(tTypedef.aliasedType, isA()); + } - void test_basicFunctionTypedef() async { + void test_function_basic() async { var library = await bootPackageWithLibrary(''' /// Line _one_. /// @@ -52,7 +77,7 @@ Line _two_.''');

Line two.

'''); } - void test_genericFunctionTypedef() async { + void test_function_generic() async { var library = await bootPackageWithLibrary(''' typedef Cb2 = T Function(T); '''); @@ -69,7 +94,7 @@ typedef Cb2 = T Function(T); expect(cb2Typedef.aliasedType, isA()); } - void test_genericFunctionTypedefReferringToGenericTypedef() async { + void test_function_generic_referringToGenericTypedef() async { var library = await bootPackageWithLibrary(''' typedef Cb2 = T Function(T); @@ -92,7 +117,7 @@ typedef Cb3 = Cb2>; // TODO(srawlins): Dramatically improve typedef testing. } - void test_typedefInDocCommentReference() async { + void test_inDocCommentReference() async { var library = await bootPackageWithLibrary(''' typedef Cb2 = T Function(T); @@ -111,7 +136,39 @@ typedef Cb3 = Cb2>; ); } - void test_basicRecordTypedef() async { + void test_inDocCommentReference2() async { + var library = await bootPackageWithLibrary(''' +typedef R2 = (T, String); + +/// Not unlike [R2]. +typedef R3 = R2>; +'''); + final r3Typedef = library.typedefs.named('R3'); + + expect(r3Typedef.isDocumented, isTrue); + + expect(r3Typedef.documentation, 'Not unlike [R2].'); + + expect( + r3Typedef.documentationAsHtml, + '

Not unlike ' + 'R2.' + '

', + ); + } + + void test_mixin_basic() async { + var library = await bootPackageWithLibrary(''' +mixin M {} +typedef T = M; +'''); + final tTypedef = library.typedefs.named('T'); + expect(tTypedef.nameWithGenerics, 'T'); + expect(tTypedef.genericParameters, ''); + expect(tTypedef.aliasedType, isA()); + } + + void test_record_basic() async { var library = await bootPackageWithLibrary(''' /// Line _one_. /// @@ -137,7 +194,7 @@ Line _two_.''');

Line two.

'''); } - void test_genericRecordTypedef() async { + void test_record_generic() async { var library = await bootPackageWithLibrary(''' typedef R2 = (T, String); '''); @@ -154,7 +211,7 @@ typedef R2 = (T, String); expect(r2Typedef.aliasedType, isA()); } - void test_genericRecordTypedefReferringToGenericTypedef() async { + void test_record_generic_referringToGenericTypedef() async { var library = await bootPackageWithLibrary(''' typedef R2 = (T, String); @@ -174,28 +231,7 @@ typedef R3 = R2>; expect(r3Typedef.aliasedType, isA()); } - void test_typedefInDocCommentReference2() async { - var library = await bootPackageWithLibrary(''' -typedef R2 = (T, String); - -/// Not unlike [R2]. -typedef R3 = R2>; -'''); - final r3Typedef = library.typedefs.named('R3'); - - expect(r3Typedef.isDocumented, isTrue); - - expect(r3Typedef.documentation, 'Not unlike [R2].'); - - expect( - r3Typedef.documentationAsHtml, - '

Not unlike ' - 'R2.' - '

', - ); - } - - void test_typedefRetainsAliasWhenUsed() async { + void test_retainsAliasWhenUsed() async { var library = await bootPackageWithLibrary(''' typedef R = (T, String);