From bee012e2678e24ba519cd1ccbe64e5ca095df2e4 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Tue, 26 Sep 2017 13:41:28 -0700 Subject: [PATCH 01/18] Basic functionality for typed functions without typedefs --- lib/src/element_type.dart | 48 ++-- lib/src/html/template_data.dart | 3 +- lib/src/model.dart | 71 ++++- pubspec.lock | 16 +- pubspec.yaml | 2 +- test/model_test.dart | 16 +- testing/test_package/lib/example.dart | 6 + .../test_package_docs/ex/Animal-class.html | 1 + testing/test_package_docs/ex/Apple-class.html | 1 + testing/test_package_docs/ex/B-class.html | 1 + .../test_package_docs/ex/COLOR-constant.html | 1 + .../ex/COLOR_GREEN-constant.html | 1 + .../ex/COLOR_ORANGE-constant.html | 1 + .../ex/COMPLEX_COLOR-constant.html | 1 + testing/test_package_docs/ex/Cat-class.html | 1 + .../test_package_docs/ex/CatString-class.html | 1 + .../ex/ConstantCat-class.html | 1 + .../ex/Deprecated-class.html | 1 + testing/test_package_docs/ex/Dog-class.html | 1 + testing/test_package_docs/ex/E-class.html | 1 + testing/test_package_docs/ex/F-class.html | 1 + .../ex/ForAnnotation-class.html | 1 + .../ex/HasAnnotation-class.html | 1 + .../test_package_docs/ex/Helper-class.html | 1 + testing/test_package_docs/ex/Klass-class.html | 1 + .../test_package_docs/ex/MY_CAT-constant.html | 1 + .../test_package_docs/ex/MyError-class.html | 1 + .../ex/MyErrorImplements-class.html | 1 + .../ex/MyException-class.html | 1 + .../ex/MyExceptionImplements-class.html | 1 + .../ex/PRETTY_COLORS-constant.html | 1 + .../ex/ParameterizedTypedef.html | 1 + .../PublicClassExtendsPrivateClass-class.html | 1 + ...ClassImplementsPrivateInterface-class.html | 1 + .../test_package_docs/ex/ShapeType-class.html | 1 + .../ex/SpecializedDuration-class.html | 1 + .../TypedFunctionsWithoutTypedefs-class.html | 245 ++++++++++++++++++ .../TypedFunctionsWithoutTypedefs.html | 101 ++++++++ .../getAFunctionReturningVoid.html | 100 +++++++ .../hashCode.html | 105 ++++++++ .../noSuchMethod.html | 100 +++++++ .../operator_equals.html | 100 +++++++ .../runtimeType.html | 105 ++++++++ .../toString.html | 100 +++++++ .../ex/WithGeneric-class.html | 1 + .../ex/WithGenericSub-class.html | 1 + .../ex/aThingToDo-class.html | 1 + .../ex/deprecated-constant.html | 1 + .../test_package_docs/ex/deprecatedField.html | 1 + .../ex/deprecatedGetter.html | 1 + .../ex/deprecatedSetter.html | 1 + testing/test_package_docs/ex/ex-library.html | 7 + testing/test_package_docs/ex/function1.html | 1 + .../test_package_docs/ex/genericFunction.html | 1 + .../ex/incorrectDocReference-constant.html | 1 + .../incorrectDocReferenceFromEx-constant.html | 1 + testing/test_package_docs/ex/number.html | 1 + .../test_package_docs/ex/processMessage.html | 1 + testing/test_package_docs/ex/y.html | 1 + testing/test_package_docs/index.json | 88 +++++++ 60 files changed, 1214 insertions(+), 42 deletions(-) create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs-class.html create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/hashCode.html create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/operator_equals.html create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/runtimeType.html create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/toString.html diff --git a/lib/src/element_type.dart b/lib/src/element_type.dart index d3e3abb865..2f0e20866a 100644 --- a/lib/src/element_type.dart +++ b/lib/src/element_type.dart @@ -22,10 +22,9 @@ class ElementType { bool get isFunctionType => (_type is FunctionType); bool get isParameterizedType { - if (_type is FunctionType) { - return typeArguments.isNotEmpty; - } else if (_type is ParameterizedType) { - return (_type as ParameterizedType).typeArguments.isNotEmpty; + // _type can be both; prioritize ParameterizedType. + if (_type is ParameterizedType || _type is FunctionType) { + return true; } return false; } @@ -33,30 +32,31 @@ class ElementType { bool get isParameterType => (_type is TypeParameterType); String get linkedName { - if (_linkedName != null) return _linkedName; + if (_linkedName == null) { + StringBuffer buf = new StringBuffer(); - StringBuffer buf = new StringBuffer(); - - if (isParameterType) { - buf.write(name); - } else { - buf.write(element.linkedName); - } - - // not TypeParameterType or Void or Union type - if (isParameterizedType) { - if (typeArguments.every((t) => t.linkedName == 'dynamic')) { - _linkedName = buf.toString(); - return _linkedName; + if (isParameterType) { + buf.write(name); + } else { + buf.write(element.linkedName); } - if (typeArguments.isNotEmpty) { - buf.write('<'); - buf.writeAll(typeArguments.map((t) => t.linkedName), ', '); - buf.write('>'); + + // not TypeParameterType or Void or Union type + if (isParameterizedType) { + if (!typeArguments.every((t) => t.linkedName == 'dynamic') && + typeArguments.isNotEmpty) { + buf.write('<'); + buf.writeAll(typeArguments.map((t) => t.linkedName), ', '); + buf.write('>'); + } + if (element.canHaveParameters && !ModelFunctionTyped.isPartOfTypedef(element.element)) { + buf.write('('); + buf.write(element.linkedParams()); + buf.write(')'); + } } + _linkedName = buf.toString(); } - _linkedName = buf.toString(); - return _linkedName; } diff --git a/lib/src/html/template_data.dart b/lib/src/html/template_data.dart index e14b6e6320..af09c560f1 100644 --- a/lib/src/html/template_data.dart +++ b/lib/src/html/template_data.dart @@ -180,8 +180,7 @@ class ClassTemplateData extends TemplateData { '${library.name} library, for the Dart programming language.'; @override - String get layoutTitle => - _layoutTitle(clazz.nameWithGenerics, clazz.fullkind, clazz.isDeprecated); + String get layoutTitle => _layoutTitle(clazz.nameWithGenerics, clazz.fullkind, clazz.isDeprecated); @override List get navLinks => [package, library]; @override diff --git a/lib/src/model.dart b/lib/src/model.dart index d63c9478d6..bf4b2b9756 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -769,7 +769,7 @@ class Class extends ModelElement implements EnclosedElement { @override String get nameWithGenerics { - if (!modelType.isParameterizedType) return name; + if (!modelType.isParameterizedType || _typeParameters.isEmpty) return name; return '$name<${_typeParameters.map((t) => t.name).join(', ')}>'; } @@ -2285,9 +2285,13 @@ abstract class ModelElement extends Nameable } } } - // TODO(jcollins-g): Consider subclass for ModelFunctionTyped. + if (e is GenericFunctionTypeElement) { - newModelElement = new ModelFunctionTyped(e, library); + if (ModelFunctionTyped.isPartOfTypedef(e)) { + newModelElement = new ModelFunctionTypedef(e, library); + } else { + newModelElement = new ModelFunctionAnonymous(e, library); + } } if (newModelElement == null) throw "Unknown type ${e.runtimeType}"; @@ -3203,6 +3207,7 @@ abstract class ModelElement extends Nameable } } +/// A ModelElement for a FunctionElement that isn't part of a type definition. class ModelFunction extends ModelFunctionTyped { ModelFunction(FunctionElement element, Library library) : super(element, library); @@ -3212,10 +3217,50 @@ class ModelFunction extends ModelFunctionTyped { return _func.isStatic; } + @override + String get name { + if (element.enclosingElement is ParameterElement && super.name.isEmpty) + return element.enclosingElement.name; + return super.name; + } + @override FunctionElement get _func => (element as FunctionElement); } + +/// A ModelElement for a GenericModelFunctionElement that is not part of an +/// explicit typedef. +class ModelFunctionAnonymous extends ModelFunctionTyped { + ModelFunctionAnonymous(FunctionTypedElement element, Library library) + : super(element, library) {} + + @override + String get name => 'Function'; + + @override + bool get isPublic => false; +} + +/// A ModelElement for a GenericModelFunctionElement that may be part of an +/// explicit typedef. +class ModelFunctionTypedef extends ModelFunctionTyped { + ModelFunctionTypedef(FunctionTypedElement element, Library library) + : super(element, library) {} + + @override + String get name { + Element e = element; + while (e != null) { + if (e is FunctionTypeAliasElement) + return e.name; + e = e.enclosingElement; + } + assert(false); + return super.name; + } +} + class ModelFunctionTyped extends ModelElement with SourceCodeMixin implements EnclosedElement { @@ -3238,13 +3283,6 @@ class ModelFunctionTyped extends ModelElement String get fileName => "$name.html"; - @override - String get name { - if (element.enclosingElement is ParameterElement && super.name.isEmpty) - return element.enclosingElement.name; - return super.name; - } - @override String get href { if (canonicalLibrary == null) return null; @@ -3268,6 +3306,17 @@ class ModelFunctionTyped extends ModelElement return '<${typeParameters.map((t) => t.name).join(', ')}>'; } + /// Returns true if the given [FunctionTypedElement] is enclosed by a + /// [FunctionTypeAliasElement]. + static bool isPartOfTypedef(FunctionTypedElement e) { + Element next = e; + while (next != null) { + if (next is FunctionTypeAliasElement) return true; + next = next.enclosingElement; + } + return false; + } + FunctionTypedElement get _func => (element as FunctionTypedElement); } @@ -4590,7 +4639,7 @@ class Typedef extends ModelElement @override String get nameWithGenerics { - if (!modelType.isParameterizedType) return name; + if (!modelType.isParameterizedType || _typeParameters.isEmpty) return name; return '$name<${_typeParameters.map((t) => t.name).join(', ')}>'; } diff --git a/pubspec.lock b/pubspec.lock index ce8484b9db..06b731f26a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -121,6 +121,12 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + js: + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.1" kernel: description: name: kernel @@ -169,6 +175,12 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + node_preamble: + description: + name: node_preamble + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" package_config: description: name: package_config @@ -294,7 +306,7 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "0.12.20+13" + version: "0.12.24+6" tuple: description: name: tuple @@ -350,4 +362,4 @@ packages: source: hosted version: "2.1.12" sdks: - dart: ">=1.23.0-dev.11.5 <2.0.0-dev.infinity" + dart: ">=1.23.0 <=2.0.0-dev.1.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1c3ec9dfc2..0d5ce9a92d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,6 @@ dev_dependencies: http: ^0.11.0 meta: ^1.0.0 pub_semver: ^1.0.0 - test: ^0.12.0 + test: '>=0.12.20+24 <0.13.0' executables: dartdoc: null diff --git a/test/model_test.dart b/test/model_test.dart index e2a0d33604..96ad362055 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -686,7 +686,7 @@ void main() { }); test('correctly finds all the classes', () { - expect(classes, hasLength(21)); + expect(classes, hasLength(22)); }); test('abstract', () { @@ -1027,9 +1027,10 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans, }); group('Method', () { - Class classB, klass, HasGenerics, Cat, CatString; + Class classB, klass, HasGenerics, Cat, CatString, TypedFunctionsWithoutTypedefs; Method m1, isGreaterThan, m4, m5, m6, m7, convertToMap, abstractMethod; Method inheritedClear, testGeneric, testGenericMethod; + Method getAFunctionReturningVoid; setUp(() { klass = exLibrary.classes.singleWhere((c) => c.name == 'Klass'); @@ -1061,6 +1062,8 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans, .singleWhere((m) => m.name == 'testGenericMethod'); convertToMap = HasGenerics.instanceMethods .singleWhere((m) => m.name == 'convertToMap'); + TypedFunctionsWithoutTypedefs = exLibrary.classes.singleWhere((c) => c.name == 'TypedFunctionsWithoutTypedefs'); + getAFunctionReturningVoid = TypedFunctionsWithoutTypedefs.instanceMethods.singleWhere((m) => m.name == 'getAFunctionReturningVoid'); }); tearDown(() { @@ -1070,6 +1073,15 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans, } }); + test('verify parameters to types are displayed', () { + var matcher = new RegExp('Function\\(T. T.\\)'); + expect(matcher.hasMatch(getAFunctionReturningVoid.linkedReturnType), isTrue); + }); + + test('verify parameter types are correctly displayed', () { + expect(getAFunctionReturningVoid.linkedReturnType, equals('Function(T1 T2)')); + }, skip: 'blocked on https://github.com/dart-lang/sdk/issues/30146'); + test('has a fully qualified name', () { expect(m1.fullyQualifiedName, 'ex.B.m1'); }); diff --git a/testing/test_package/lib/example.dart b/testing/test_package/lib/example.dart index 48ef950caa..813c0cc0ce 100644 --- a/testing/test_package/lib/example.dart +++ b/testing/test_package/lib/example.dart @@ -424,3 +424,9 @@ class _RetainedEnum { @override String toString() => name; } + +/// This class has a complicated type situation. +abstract class TypedFunctionsWithoutTypedefs { + void Function(T1, T2) getAFunctionReturningVoid( + void callback(T1 argument1, T2 argument2)); +} \ No newline at end of file diff --git a/testing/test_package_docs/ex/Animal-class.html b/testing/test_package_docs/ex/Animal-class.html index 0fe98ee336..8df1c2c4fa 100644 --- a/testing/test_package_docs/ex/Animal-class.html +++ b/testing/test_package_docs/ex/Animal-class.html @@ -58,6 +58,7 @@
library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/Apple-class.html b/testing/test_package_docs/ex/Apple-class.html index 1201252602..0d14a73411 100644 --- a/testing/test_package_docs/ex/Apple-class.html +++ b/testing/test_package_docs/ex/Apple-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/B-class.html b/testing/test_package_docs/ex/B-class.html index 292d90e4a9..98fe8166a0 100644 --- a/testing/test_package_docs/ex/B-class.html +++ b/testing/test_package_docs/ex/B-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/COLOR-constant.html b/testing/test_package_docs/ex/COLOR-constant.html index 699abfb870..2b075313dd 100644 --- a/testing/test_package_docs/ex/COLOR-constant.html +++ b/testing/test_package_docs/ex/COLOR-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/COLOR_GREEN-constant.html b/testing/test_package_docs/ex/COLOR_GREEN-constant.html index 3b794c6b81..875c838b05 100644 --- a/testing/test_package_docs/ex/COLOR_GREEN-constant.html +++ b/testing/test_package_docs/ex/COLOR_GREEN-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/COLOR_ORANGE-constant.html b/testing/test_package_docs/ex/COLOR_ORANGE-constant.html index 8d44709c8e..ad2b2baf59 100644 --- a/testing/test_package_docs/ex/COLOR_ORANGE-constant.html +++ b/testing/test_package_docs/ex/COLOR_ORANGE-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/COMPLEX_COLOR-constant.html b/testing/test_package_docs/ex/COMPLEX_COLOR-constant.html index c7bd01fe0e..22a6b70bee 100644 --- a/testing/test_package_docs/ex/COMPLEX_COLOR-constant.html +++ b/testing/test_package_docs/ex/COMPLEX_COLOR-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/Cat-class.html b/testing/test_package_docs/ex/Cat-class.html index 6e46a34fd2..21b0f4387e 100644 --- a/testing/test_package_docs/ex/Cat-class.html +++ b/testing/test_package_docs/ex/Cat-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/CatString-class.html b/testing/test_package_docs/ex/CatString-class.html index 09bfc12b11..3b58352538 100644 --- a/testing/test_package_docs/ex/CatString-class.html +++ b/testing/test_package_docs/ex/CatString-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/ConstantCat-class.html b/testing/test_package_docs/ex/ConstantCat-class.html index f943f6b0c3..03740c3047 100644 --- a/testing/test_package_docs/ex/ConstantCat-class.html +++ b/testing/test_package_docs/ex/ConstantCat-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/Deprecated-class.html b/testing/test_package_docs/ex/Deprecated-class.html index bdbc665f92..ca323702f4 100644 --- a/testing/test_package_docs/ex/Deprecated-class.html +++ b/testing/test_package_docs/ex/Deprecated-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/Dog-class.html b/testing/test_package_docs/ex/Dog-class.html index cfa3a83c0a..3ae2681136 100644 --- a/testing/test_package_docs/ex/Dog-class.html +++ b/testing/test_package_docs/ex/Dog-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/E-class.html b/testing/test_package_docs/ex/E-class.html index a6314975f6..8a52a9e80e 100644 --- a/testing/test_package_docs/ex/E-class.html +++ b/testing/test_package_docs/ex/E-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/F-class.html b/testing/test_package_docs/ex/F-class.html index 042c1de8d7..f5d22e7092 100644 --- a/testing/test_package_docs/ex/F-class.html +++ b/testing/test_package_docs/ex/F-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/ForAnnotation-class.html b/testing/test_package_docs/ex/ForAnnotation-class.html index 0d10129717..677932e3a8 100644 --- a/testing/test_package_docs/ex/ForAnnotation-class.html +++ b/testing/test_package_docs/ex/ForAnnotation-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/HasAnnotation-class.html b/testing/test_package_docs/ex/HasAnnotation-class.html index 9b2205bec0..f6ac17d14d 100644 --- a/testing/test_package_docs/ex/HasAnnotation-class.html +++ b/testing/test_package_docs/ex/HasAnnotation-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/Helper-class.html b/testing/test_package_docs/ex/Helper-class.html index 429cc79a07..2eb7b88a7e 100644 --- a/testing/test_package_docs/ex/Helper-class.html +++ b/testing/test_package_docs/ex/Helper-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/Klass-class.html b/testing/test_package_docs/ex/Klass-class.html index cfbb3debde..1f90567b44 100644 --- a/testing/test_package_docs/ex/Klass-class.html +++ b/testing/test_package_docs/ex/Klass-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/MY_CAT-constant.html b/testing/test_package_docs/ex/MY_CAT-constant.html index a21d4d3e36..3fbb3b96f0 100644 --- a/testing/test_package_docs/ex/MY_CAT-constant.html +++ b/testing/test_package_docs/ex/MY_CAT-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/MyError-class.html b/testing/test_package_docs/ex/MyError-class.html index e359f75824..08b18b9a24 100644 --- a/testing/test_package_docs/ex/MyError-class.html +++ b/testing/test_package_docs/ex/MyError-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/MyErrorImplements-class.html b/testing/test_package_docs/ex/MyErrorImplements-class.html index d295d2faa9..69fd25aa79 100644 --- a/testing/test_package_docs/ex/MyErrorImplements-class.html +++ b/testing/test_package_docs/ex/MyErrorImplements-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/MyException-class.html b/testing/test_package_docs/ex/MyException-class.html index 25f6fa8872..c79719e5fa 100644 --- a/testing/test_package_docs/ex/MyException-class.html +++ b/testing/test_package_docs/ex/MyException-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/MyExceptionImplements-class.html b/testing/test_package_docs/ex/MyExceptionImplements-class.html index 36d4658e92..48f9a111b2 100644 --- a/testing/test_package_docs/ex/MyExceptionImplements-class.html +++ b/testing/test_package_docs/ex/MyExceptionImplements-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/PRETTY_COLORS-constant.html b/testing/test_package_docs/ex/PRETTY_COLORS-constant.html index e08f187e14..5ebf026391 100644 --- a/testing/test_package_docs/ex/PRETTY_COLORS-constant.html +++ b/testing/test_package_docs/ex/PRETTY_COLORS-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/ParameterizedTypedef.html b/testing/test_package_docs/ex/ParameterizedTypedef.html index 2332da0bcf..e739f8f3b4 100644 --- a/testing/test_package_docs/ex/ParameterizedTypedef.html +++ b/testing/test_package_docs/ex/ParameterizedTypedef.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/PublicClassExtendsPrivateClass-class.html b/testing/test_package_docs/ex/PublicClassExtendsPrivateClass-class.html index 4bf53930ab..7b4374fc06 100644 --- a/testing/test_package_docs/ex/PublicClassExtendsPrivateClass-class.html +++ b/testing/test_package_docs/ex/PublicClassExtendsPrivateClass-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/PublicClassImplementsPrivateInterface-class.html b/testing/test_package_docs/ex/PublicClassImplementsPrivateInterface-class.html index ab3aa9ea39..089430d860 100644 --- a/testing/test_package_docs/ex/PublicClassImplementsPrivateInterface-class.html +++ b/testing/test_package_docs/ex/PublicClassImplementsPrivateInterface-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/ShapeType-class.html b/testing/test_package_docs/ex/ShapeType-class.html index 506e078677..1861f63cba 100644 --- a/testing/test_package_docs/ex/ShapeType-class.html +++ b/testing/test_package_docs/ex/ShapeType-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/SpecializedDuration-class.html b/testing/test_package_docs/ex/SpecializedDuration-class.html index c8d1947a0e..9e8e04931e 100644 --- a/testing/test_package_docs/ex/SpecializedDuration-class.html +++ b/testing/test_package_docs/ex/SpecializedDuration-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs-class.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs-class.html new file mode 100644 index 0000000000..6be87520b9 --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs-class.html @@ -0,0 +1,245 @@ + + + + + + + + TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    TypedFunctionsWithoutTypedefs
    + +
    + +
    + + + +
    + +
    +

    This class has a complicated type situation.

    +
    + + +
    +

    Constructors

    + +
    +
    + TypedFunctionsWithoutTypedefs() +
    +
    + +
    +
    +
    + +
    +

    Properties

    + +
    +
    + hashCode + → int +
    +
    + +
    read-only, inherited
    +
    +
    + runtimeType + → Type +
    +
    + +
    read-only, inherited
    +
    +
    +
    + +
    +

    Methods

    +
    +
    + getAFunctionReturningVoid<T1, T2>(void callback(T1 argument1, T2 argument2)) + → Function(T1 T1) + +
    +
    + + +
    +
    + noSuchMethod(Invocation invocation) + → dynamic + +
    +
    + +
    inherited
    +
    +
    + toString() + → String + +
    +
    + +
    inherited
    +
    +
    +
    + +
    +

    Operators

    +
    +
    + operator ==(other) + → bool + +
    +
    + +
    inherited
    +
    +
    +
    + + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html new file mode 100644 index 0000000000..c68e45006c --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html @@ -0,0 +1,101 @@ + + + + + + + + TypedFunctionsWithoutTypedefs constructor - TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    TypedFunctionsWithoutTypedefs
    + +
    + +
    + + + +
    +
    + + TypedFunctionsWithoutTypedefs() +
    + + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html new file mode 100644 index 0000000000..a2a37141e6 --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html @@ -0,0 +1,100 @@ + + + + + + + + getAFunctionReturningVoid method - TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    getAFunctionReturningVoid
    + +
    + +
    + + + +
    +
    + Function(T1 T1) + getAFunctionReturningVoid<T1, T2>(void callback(T1 argument1, T2 argument2)) +
    + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/hashCode.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/hashCode.html new file mode 100644 index 0000000000..e634006cc4 --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/hashCode.html @@ -0,0 +1,105 @@ + + + + + + + + hashCode property - TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    hashCode
    + +
    + +
    + + + +
    + + +
    + +
    + int + hashCode
    + +
    + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html new file mode 100644 index 0000000000..6f8977d9e3 --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html @@ -0,0 +1,100 @@ + + + + + + + + noSuchMethod method - TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    noSuchMethod
    + +
    + +
    + + + +
    +
    + dynamic + noSuchMethod(Invocation invocation) +
    + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/operator_equals.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/operator_equals.html new file mode 100644 index 0000000000..4a42f08aa1 --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/operator_equals.html @@ -0,0 +1,100 @@ + + + + + + + + operator == method - TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    operator ==
    + +
    + +
    + + + +
    +
    + bool + operator ==(other) +
    + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/runtimeType.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/runtimeType.html new file mode 100644 index 0000000000..e114d56870 --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/runtimeType.html @@ -0,0 +1,105 @@ + + + + + + + + runtimeType property - TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    runtimeType
    + +
    + +
    + + + +
    + + +
    + +
    + Type + runtimeType
    + +
    + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/toString.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/toString.html new file mode 100644 index 0000000000..5e295bdb86 --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/toString.html @@ -0,0 +1,100 @@ + + + + + + + + toString method - TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    toString
    + +
    + +
    + + + +
    +
    + String + toString() +
    + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/WithGeneric-class.html b/testing/test_package_docs/ex/WithGeneric-class.html index 5569ecf293..7d25975c85 100644 --- a/testing/test_package_docs/ex/WithGeneric-class.html +++ b/testing/test_package_docs/ex/WithGeneric-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/WithGenericSub-class.html b/testing/test_package_docs/ex/WithGenericSub-class.html index 9a27bdfb7e..54711c9d70 100644 --- a/testing/test_package_docs/ex/WithGenericSub-class.html +++ b/testing/test_package_docs/ex/WithGenericSub-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/aThingToDo-class.html b/testing/test_package_docs/ex/aThingToDo-class.html index 02e0fb2b37..45f61502fc 100644 --- a/testing/test_package_docs/ex/aThingToDo-class.html +++ b/testing/test_package_docs/ex/aThingToDo-class.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/deprecated-constant.html b/testing/test_package_docs/ex/deprecated-constant.html index 5c1f8f81c1..e69c62b941 100644 --- a/testing/test_package_docs/ex/deprecated-constant.html +++ b/testing/test_package_docs/ex/deprecated-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/deprecatedField.html b/testing/test_package_docs/ex/deprecatedField.html index 9e8ae38d99..58d5428d76 100644 --- a/testing/test_package_docs/ex/deprecatedField.html +++ b/testing/test_package_docs/ex/deprecatedField.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/deprecatedGetter.html b/testing/test_package_docs/ex/deprecatedGetter.html index a193094b75..dab7881ba9 100644 --- a/testing/test_package_docs/ex/deprecatedGetter.html +++ b/testing/test_package_docs/ex/deprecatedGetter.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/deprecatedSetter.html b/testing/test_package_docs/ex/deprecatedSetter.html index 54f8fa10e1..041da97147 100644 --- a/testing/test_package_docs/ex/deprecatedSetter.html +++ b/testing/test_package_docs/ex/deprecatedSetter.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/ex-library.html b/testing/test_package_docs/ex/ex-library.html index b1becc22c9..27a0a476d9 100644 --- a/testing/test_package_docs/ex/ex-library.html +++ b/testing/test_package_docs/ex/ex-library.html @@ -180,6 +180,12 @@

    Classes

    For testing a class that extends a class that has some operators +
    + TypedFunctionsWithoutTypedefs +
    +
    + This class has a complicated type situation. +
    WithGeneric
    @@ -471,6 +477,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/function1.html b/testing/test_package_docs/ex/function1.html index 6cb1e6f731..0ace605eb7 100644 --- a/testing/test_package_docs/ex/function1.html +++ b/testing/test_package_docs/ex/function1.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/genericFunction.html b/testing/test_package_docs/ex/genericFunction.html index f9d0bc6149..ad10a5d673 100644 --- a/testing/test_package_docs/ex/genericFunction.html +++ b/testing/test_package_docs/ex/genericFunction.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/incorrectDocReference-constant.html b/testing/test_package_docs/ex/incorrectDocReference-constant.html index 3eecae8efa..e4bca5125e 100644 --- a/testing/test_package_docs/ex/incorrectDocReference-constant.html +++ b/testing/test_package_docs/ex/incorrectDocReference-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/incorrectDocReferenceFromEx-constant.html b/testing/test_package_docs/ex/incorrectDocReferenceFromEx-constant.html index 5edf6d085b..804895f786 100644 --- a/testing/test_package_docs/ex/incorrectDocReferenceFromEx-constant.html +++ b/testing/test_package_docs/ex/incorrectDocReferenceFromEx-constant.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/number.html b/testing/test_package_docs/ex/number.html index d973d2521f..96cc7f5d63 100644 --- a/testing/test_package_docs/ex/number.html +++ b/testing/test_package_docs/ex/number.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/processMessage.html b/testing/test_package_docs/ex/processMessage.html index 61c17a07a4..f6c596e866 100644 --- a/testing/test_package_docs/ex/processMessage.html +++ b/testing/test_package_docs/ex/processMessage.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/ex/y.html b/testing/test_package_docs/ex/y.html index 1f7fbf87af..a0af0dc687 100644 --- a/testing/test_package_docs/ex/y.html +++ b/testing/test_package_docs/ex/y.html @@ -58,6 +58,7 @@
    library ex
  • PublicClassImplementsPrivateInterface
  • ShapeType
  • SpecializedDuration
  • +
  • TypedFunctionsWithoutTypedefs
  • WithGeneric
  • WithGenericSub
  • diff --git a/testing/test_package_docs/index.json b/testing/test_package_docs/index.json index 09b1c05a7f..4a27e9edf4 100644 --- a/testing/test_package_docs/index.json +++ b/testing/test_package_docs/index.json @@ -2707,6 +2707,94 @@ "type": "class" } }, + { + "name": "TypedFunctionsWithoutTypedefs", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs", + "href": "ex/TypedFunctionsWithoutTypedefs-class.html", + "type": "class", + "overriddenDepth": 0, + "enclosedBy": { + "name": "ex", + "type": "library" + } + }, + { + "name": "TypedFunctionsWithoutTypedefs", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs", + "href": "ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html", + "type": "constructor", + "overriddenDepth": 0, + "enclosedBy": { + "name": "TypedFunctionsWithoutTypedefs", + "type": "class" + } + }, + { + "name": "operator ==", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs.==", + "href": "ex/TypedFunctionsWithoutTypedefs/operator_equals.html", + "type": "method", + "overriddenDepth": 0, + "enclosedBy": { + "name": "TypedFunctionsWithoutTypedefs", + "type": "class" + } + }, + { + "name": "getAFunctionReturningVoid", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs.getAFunctionReturningVoid", + "href": "ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html", + "type": "method", + "overriddenDepth": 0, + "enclosedBy": { + "name": "TypedFunctionsWithoutTypedefs", + "type": "class" + } + }, + { + "name": "hashCode", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs.hashCode", + "href": "ex/TypedFunctionsWithoutTypedefs/hashCode.html", + "type": "property", + "overriddenDepth": 0, + "enclosedBy": { + "name": "TypedFunctionsWithoutTypedefs", + "type": "class" + } + }, + { + "name": "noSuchMethod", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs.noSuchMethod", + "href": "ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html", + "type": "method", + "overriddenDepth": 0, + "enclosedBy": { + "name": "TypedFunctionsWithoutTypedefs", + "type": "class" + } + }, + { + "name": "runtimeType", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs.runtimeType", + "href": "ex/TypedFunctionsWithoutTypedefs/runtimeType.html", + "type": "property", + "overriddenDepth": 0, + "enclosedBy": { + "name": "TypedFunctionsWithoutTypedefs", + "type": "class" + } + }, + { + "name": "toString", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs.toString", + "href": "ex/TypedFunctionsWithoutTypedefs/toString.html", + "type": "method", + "overriddenDepth": 0, + "enclosedBy": { + "name": "TypedFunctionsWithoutTypedefs", + "type": "class" + } + }, { "name": "WithGeneric", "qualifiedName": "ex.WithGeneric", From 4d8a8c92a351e8b1c1349df05a92168efb9b4fe4 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 27 Sep 2017 13:32:36 -0700 Subject: [PATCH 02/18] Refactor and add more tests --- lib/src/element_type.dart | 12 +- lib/src/model.dart | 21 +-- test/model_test.dart | 13 ++ testing/test_package/lib/example.dart | 7 + .../test_package_docs/ex/Animal-class.html | 1 + testing/test_package_docs/ex/Apple-class.html | 1 + testing/test_package_docs/ex/B-class.html | 1 + .../test_package_docs/ex/COLOR-constant.html | 1 + .../ex/COLOR_GREEN-constant.html | 1 + .../ex/COLOR_ORANGE-constant.html | 1 + .../ex/COMPLEX_COLOR-constant.html | 1 + testing/test_package_docs/ex/Cat-class.html | 1 + .../test_package_docs/ex/CatString-class.html | 1 + .../ex/ConstantCat-class.html | 1 + .../ex/Deprecated-class.html | 1 + testing/test_package_docs/ex/Dog-class.html | 1 + testing/test_package_docs/ex/E-class.html | 1 + testing/test_package_docs/ex/F-class.html | 1 + .../ex/ForAnnotation-class.html | 1 + .../ex/HasAnnotation-class.html | 1 + .../test_package_docs/ex/Helper-class.html | 1 + testing/test_package_docs/ex/Klass-class.html | 1 + .../test_package_docs/ex/MY_CAT-constant.html | 1 + .../test_package_docs/ex/MyError-class.html | 1 + .../ex/MyErrorImplements-class.html | 1 + .../ex/MyException-class.html | 1 + .../ex/MyExceptionImplements-class.html | 1 + .../ex/PRETTY_COLORS-constant.html | 1 + .../ex/ParameterizedTypedef.html | 1 + .../PublicClassExtendsPrivateClass-class.html | 1 + ...ClassImplementsPrivateInterface-class.html | 1 + .../test_package_docs/ex/ShapeType-class.html | 1 + .../ex/SpecializedDuration-class.html | 1 + .../TypedFunctionsWithoutTypedefs-class.html | 13 +- .../TypedFunctionsWithoutTypedefs.html | 1 + .../getAComplexTypedef.html | 104 +++++++++++++ .../getAFunctionReturningVoid.html | 4 + .../hashCode.html | 1 + .../noSuchMethod.html | 1 + .../operator_equals.html | 1 + .../runtimeType.html | 1 + .../toString.html | 1 + .../ex/WithGeneric-class.html | 1 + .../ex/WithGenericSub-class.html | 1 + .../test_package_docs/ex/aComplexTypedef.html | 143 ++++++++++++++++++ .../ex/aThingToDo-class.html | 1 + .../ex/deprecated-constant.html | 1 + .../test_package_docs/ex/deprecatedField.html | 1 + .../ex/deprecatedGetter.html | 1 + .../ex/deprecatedSetter.html | 1 + testing/test_package_docs/ex/ex-library.html | 10 ++ testing/test_package_docs/ex/function1.html | 1 + .../test_package_docs/ex/genericFunction.html | 1 + .../ex/incorrectDocReference-constant.html | 1 + .../incorrectDocReferenceFromEx-constant.html | 1 + testing/test_package_docs/ex/number.html | 1 + .../test_package_docs/ex/processMessage.html | 1 + testing/test_package_docs/ex/y.html | 1 + testing/test_package_docs/index.json | 22 +++ 59 files changed, 376 insertions(+), 22 deletions(-) create mode 100644 testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAComplexTypedef.html create mode 100644 testing/test_package_docs/ex/aComplexTypedef.html diff --git a/lib/src/element_type.dart b/lib/src/element_type.dart index 2f0e20866a..c2bee91dc0 100644 --- a/lib/src/element_type.dart +++ b/lib/src/element_type.dart @@ -21,13 +21,7 @@ class ElementType { bool get isFunctionType => (_type is FunctionType); - bool get isParameterizedType { - // _type can be both; prioritize ParameterizedType. - if (_type is ParameterizedType || _type is FunctionType) { - return true; - } - return false; - } + bool get isParameterizedType => (_type is ParameterizedType); bool get isParameterType => (_type is TypeParameterType); @@ -49,7 +43,9 @@ class ElementType { buf.writeAll(typeArguments.map((t) => t.linkedName), ', '); buf.write('>'); } - if (element.canHaveParameters && !ModelFunctionTyped.isPartOfTypedef(element.element)) { + // Hide parameters if there's a an explicit typedef behind this + // element, but if there is no typedef, be explicit. + if (element is ModelFunctionAnonymous) { buf.write('('); buf.write(element.linkedParams()); buf.write(')'); diff --git a/lib/src/model.dart b/lib/src/model.dart index bf4b2b9756..f70aa4d505 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -2287,9 +2287,11 @@ abstract class ModelElement extends Nameable } if (e is GenericFunctionTypeElement) { - if (ModelFunctionTyped.isPartOfTypedef(e)) { + if (e is FunctionTypeAliasElement) { + assert(e.name != ''); newModelElement = new ModelFunctionTypedef(e, library); } else { + assert(e.name == ''); newModelElement = new ModelFunctionAnonymous(e, library); } } @@ -3229,8 +3231,12 @@ class ModelFunction extends ModelFunctionTyped { } -/// A ModelElement for a GenericModelFunctionElement that is not part of an +/// A [ModelElement] for a [GenericModelFunctionElement] that is not an /// explicit typedef. +/// +/// Distinct from ModelFunctionTypedef in that it doesn't +/// have a name, but we document it as "Function" to match how these are +/// written in method declarations. class ModelFunctionAnonymous extends ModelFunctionTyped { ModelFunctionAnonymous(FunctionTypedElement element, Library library) : super(element, library) {} @@ -3306,17 +3312,6 @@ class ModelFunctionTyped extends ModelElement return '<${typeParameters.map((t) => t.name).join(', ')}>'; } - /// Returns true if the given [FunctionTypedElement] is enclosed by a - /// [FunctionTypeAliasElement]. - static bool isPartOfTypedef(FunctionTypedElement e) { - Element next = e; - while (next != null) { - if (next is FunctionTypeAliasElement) return true; - next = next.enclosingElement; - } - return false; - } - FunctionTypedElement get _func => (element as FunctionTypedElement); } diff --git a/test/model_test.dart b/test/model_test.dart index 96ad362055..a871805cef 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -1769,13 +1769,26 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans, group('Typedef', () { Typedef t; Typedef generic; + Typedef aComplexTypedef; setUp(() { t = exLibrary.typedefs.firstWhere((t) => t.name == 'processMessage'); generic = fakeLibrary.typedefs.firstWhere((t) => t.name == 'NewGenericTypedef'); + aComplexTypedef = exLibrary.typedefs.firstWhere((t) => t.name == 'aComplexTypedef'); }); + test('anonymous nested functions inside typedefs are handled', () { + expect(aComplexTypedef, isNotNull); + expect(aComplexTypedef.linkedReturnType, startsWith('Function')); + expect(aComplexTypedef.nameWithGenerics, equals('aComplexTypedef<A1, A2, A3>')); + }); + + test('anonymous nested functions inside typedefs are handled correctly', () { + expect(aComplexTypedef.linkedReturnType, equals('Function(A1 A2 A3)')); + expect(aComplexTypedef.linkedParamsLines, equals('A3 String')); + }, skip: 'blocked on https://github.com/dart-lang/sdk/issues/30146'); + test('has a fully qualified name', () { expect(t.fullyQualifiedName, 'ex.processMessage'); expect(generic.fullyQualifiedName, 'fake.NewGenericTypedef'); diff --git a/testing/test_package/lib/example.dart b/testing/test_package/lib/example.dart index 813c0cc0ce..fd107e5d9d 100644 --- a/testing/test_package/lib/example.dart +++ b/testing/test_package/lib/example.dart @@ -425,8 +425,15 @@ class _RetainedEnum { String toString() => name; } +/// Someone might do this some day. +typedef aComplexTypedef = void Function(A1, A2, A3) Function(A3, String); + /// This class has a complicated type situation. abstract class TypedFunctionsWithoutTypedefs { + /// Returns a function that returns a void with some generic types sprinkled in. void Function(T1, T2) getAFunctionReturningVoid( void callback(T1 argument1, T2 argument2)); + + /// Returns a complex typedef that includes some anonymous typed functions. + aComplexTypedef getAComplexTypedef(); } \ No newline at end of file diff --git a/testing/test_package_docs/ex/Animal-class.html b/testing/test_package_docs/ex/Animal-class.html index 8df1c2c4fa..1ce5ac3b42 100644 --- a/testing/test_package_docs/ex/Animal-class.html +++ b/testing/test_package_docs/ex/Animal-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/Apple-class.html b/testing/test_package_docs/ex/Apple-class.html index 0d14a73411..12c8099410 100644 --- a/testing/test_package_docs/ex/Apple-class.html +++ b/testing/test_package_docs/ex/Apple-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/B-class.html b/testing/test_package_docs/ex/B-class.html index 98fe8166a0..f552eaadb2 100644 --- a/testing/test_package_docs/ex/B-class.html +++ b/testing/test_package_docs/ex/B-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/COLOR-constant.html b/testing/test_package_docs/ex/COLOR-constant.html index 2b075313dd..7db65e13ed 100644 --- a/testing/test_package_docs/ex/COLOR-constant.html +++ b/testing/test_package_docs/ex/COLOR-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/COLOR_GREEN-constant.html b/testing/test_package_docs/ex/COLOR_GREEN-constant.html index 875c838b05..44a83c29ad 100644 --- a/testing/test_package_docs/ex/COLOR_GREEN-constant.html +++ b/testing/test_package_docs/ex/COLOR_GREEN-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/COLOR_ORANGE-constant.html b/testing/test_package_docs/ex/COLOR_ORANGE-constant.html index ad2b2baf59..455f0a7940 100644 --- a/testing/test_package_docs/ex/COLOR_ORANGE-constant.html +++ b/testing/test_package_docs/ex/COLOR_ORANGE-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/COMPLEX_COLOR-constant.html b/testing/test_package_docs/ex/COMPLEX_COLOR-constant.html index 22a6b70bee..412e7f13f0 100644 --- a/testing/test_package_docs/ex/COMPLEX_COLOR-constant.html +++ b/testing/test_package_docs/ex/COMPLEX_COLOR-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/Cat-class.html b/testing/test_package_docs/ex/Cat-class.html index 21b0f4387e..c4c99709be 100644 --- a/testing/test_package_docs/ex/Cat-class.html +++ b/testing/test_package_docs/ex/Cat-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/CatString-class.html b/testing/test_package_docs/ex/CatString-class.html index 3b58352538..d4fcfe2ad6 100644 --- a/testing/test_package_docs/ex/CatString-class.html +++ b/testing/test_package_docs/ex/CatString-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/ConstantCat-class.html b/testing/test_package_docs/ex/ConstantCat-class.html index 03740c3047..a9fb3b9eb6 100644 --- a/testing/test_package_docs/ex/ConstantCat-class.html +++ b/testing/test_package_docs/ex/ConstantCat-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/Deprecated-class.html b/testing/test_package_docs/ex/Deprecated-class.html index ca323702f4..8d201d3c62 100644 --- a/testing/test_package_docs/ex/Deprecated-class.html +++ b/testing/test_package_docs/ex/Deprecated-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/Dog-class.html b/testing/test_package_docs/ex/Dog-class.html index 3ae2681136..3e8621eb93 100644 --- a/testing/test_package_docs/ex/Dog-class.html +++ b/testing/test_package_docs/ex/Dog-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/E-class.html b/testing/test_package_docs/ex/E-class.html index 8a52a9e80e..4e1f95ad30 100644 --- a/testing/test_package_docs/ex/E-class.html +++ b/testing/test_package_docs/ex/E-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/F-class.html b/testing/test_package_docs/ex/F-class.html index f5d22e7092..49f9037a4f 100644 --- a/testing/test_package_docs/ex/F-class.html +++ b/testing/test_package_docs/ex/F-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/ForAnnotation-class.html b/testing/test_package_docs/ex/ForAnnotation-class.html index 677932e3a8..10d62f0aad 100644 --- a/testing/test_package_docs/ex/ForAnnotation-class.html +++ b/testing/test_package_docs/ex/ForAnnotation-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/HasAnnotation-class.html b/testing/test_package_docs/ex/HasAnnotation-class.html index f6ac17d14d..2ce630d085 100644 --- a/testing/test_package_docs/ex/HasAnnotation-class.html +++ b/testing/test_package_docs/ex/HasAnnotation-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/Helper-class.html b/testing/test_package_docs/ex/Helper-class.html index 2eb7b88a7e..d72c2ecece 100644 --- a/testing/test_package_docs/ex/Helper-class.html +++ b/testing/test_package_docs/ex/Helper-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/Klass-class.html b/testing/test_package_docs/ex/Klass-class.html index 1f90567b44..3321afb243 100644 --- a/testing/test_package_docs/ex/Klass-class.html +++ b/testing/test_package_docs/ex/Klass-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/MY_CAT-constant.html b/testing/test_package_docs/ex/MY_CAT-constant.html index 3fbb3b96f0..be0b07311e 100644 --- a/testing/test_package_docs/ex/MY_CAT-constant.html +++ b/testing/test_package_docs/ex/MY_CAT-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/MyError-class.html b/testing/test_package_docs/ex/MyError-class.html index 08b18b9a24..1b67cb0505 100644 --- a/testing/test_package_docs/ex/MyError-class.html +++ b/testing/test_package_docs/ex/MyError-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/MyErrorImplements-class.html b/testing/test_package_docs/ex/MyErrorImplements-class.html index 69fd25aa79..2633f73a95 100644 --- a/testing/test_package_docs/ex/MyErrorImplements-class.html +++ b/testing/test_package_docs/ex/MyErrorImplements-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/MyException-class.html b/testing/test_package_docs/ex/MyException-class.html index c79719e5fa..8ceb94001e 100644 --- a/testing/test_package_docs/ex/MyException-class.html +++ b/testing/test_package_docs/ex/MyException-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/MyExceptionImplements-class.html b/testing/test_package_docs/ex/MyExceptionImplements-class.html index 48f9a111b2..1d36c9274f 100644 --- a/testing/test_package_docs/ex/MyExceptionImplements-class.html +++ b/testing/test_package_docs/ex/MyExceptionImplements-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/PRETTY_COLORS-constant.html b/testing/test_package_docs/ex/PRETTY_COLORS-constant.html index 5ebf026391..072562df34 100644 --- a/testing/test_package_docs/ex/PRETTY_COLORS-constant.html +++ b/testing/test_package_docs/ex/PRETTY_COLORS-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/ParameterizedTypedef.html b/testing/test_package_docs/ex/ParameterizedTypedef.html index e739f8f3b4..090a6ab13c 100644 --- a/testing/test_package_docs/ex/ParameterizedTypedef.html +++ b/testing/test_package_docs/ex/ParameterizedTypedef.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/PublicClassExtendsPrivateClass-class.html b/testing/test_package_docs/ex/PublicClassExtendsPrivateClass-class.html index 7b4374fc06..0a2d715102 100644 --- a/testing/test_package_docs/ex/PublicClassExtendsPrivateClass-class.html +++ b/testing/test_package_docs/ex/PublicClassExtendsPrivateClass-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/PublicClassImplementsPrivateInterface-class.html b/testing/test_package_docs/ex/PublicClassImplementsPrivateInterface-class.html index 089430d860..dd126044fe 100644 --- a/testing/test_package_docs/ex/PublicClassImplementsPrivateInterface-class.html +++ b/testing/test_package_docs/ex/PublicClassImplementsPrivateInterface-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/ShapeType-class.html b/testing/test_package_docs/ex/ShapeType-class.html index 1861f63cba..4ca0d5bb80 100644 --- a/testing/test_package_docs/ex/ShapeType-class.html +++ b/testing/test_package_docs/ex/ShapeType-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/SpecializedDuration-class.html b/testing/test_package_docs/ex/SpecializedDuration-class.html index 9e8e04931e..dde5b730b5 100644 --- a/testing/test_package_docs/ex/SpecializedDuration-class.html +++ b/testing/test_package_docs/ex/SpecializedDuration-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs-class.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs-class.html index 6be87520b9..69c464a3e5 100644 --- a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs-class.html +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • @@ -145,13 +146,22 @@

    Properties

    Methods

    +
    + getAComplexTypedef<A4, A5, A6>() + → Function(A3 A3) + +
    +
    + Returns a complex typedef that includes some anonymous typed functions. + +
    getAFunctionReturningVoid<T1, T2>(void callback(T1 argument1, T2 argument2)) → Function(T1 T1)
    - + Returns a function that returns a void with some generic types sprinkled in.
    @@ -208,6 +218,7 @@
    class TypedFunctionsWithoutTypedefs
  • runtimeType
  • Methods
  • +
  • getAComplexTypedef
  • getAFunctionReturningVoid
  • noSuchMethod
  • toString
  • diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html index c68e45006c..81cdb960a7 100644 --- a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/TypedFunctionsWithoutTypedefs.html @@ -49,6 +49,7 @@
    class TypedFunctionsWithoutTypedefs
  • runtimeType
  • Methods
  • +
  • getAComplexTypedef
  • getAFunctionReturningVoid
  • noSuchMethod
  • toString
  • diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAComplexTypedef.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAComplexTypedef.html new file mode 100644 index 0000000000..d0e11e4f51 --- /dev/null +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAComplexTypedef.html @@ -0,0 +1,104 @@ + + + + + + + + getAComplexTypedef method - TypedFunctionsWithoutTypedefs class - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    getAComplexTypedef
    + +
    + +
    + + + +
    +
    + Function(A3 A3) + getAComplexTypedef<A4, A5, A6>() +
    +
    +

    Returns a complex typedef that includes some anonymous typed functions.

    +
    + + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html index a2a37141e6..209bd83047 100644 --- a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/getAFunctionReturningVoid.html @@ -49,6 +49,7 @@
    class TypedFunctionsWithoutTypedefs
  • runtimeType
  • Methods
  • +
  • getAComplexTypedef
  • getAFunctionReturningVoid
  • noSuchMethod
  • toString
  • @@ -66,6 +67,9 @@
    class TypedFunctionsWithoutTypedefs
    Function(T1 T1) getAFunctionReturningVoid<T1, T2>(void callback(T1 argument1, T2 argument2))
    +
    +

    Returns a function that returns a void with some generic types sprinkled in.

    +
    diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/hashCode.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/hashCode.html index e634006cc4..d6e5f193c2 100644 --- a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/hashCode.html +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/hashCode.html @@ -49,6 +49,7 @@
    class TypedFunctionsWithoutTypedefs
  • runtimeType
  • Methods
  • +
  • getAComplexTypedef
  • getAFunctionReturningVoid
  • noSuchMethod
  • toString
  • diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html index 6f8977d9e3..066eb75c3d 100644 --- a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/noSuchMethod.html @@ -49,6 +49,7 @@
    class TypedFunctionsWithoutTypedefs
  • runtimeType
  • Methods
  • +
  • getAComplexTypedef
  • getAFunctionReturningVoid
  • noSuchMethod
  • toString
  • diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/operator_equals.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/operator_equals.html index 4a42f08aa1..e515e6d5c6 100644 --- a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/operator_equals.html +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/operator_equals.html @@ -49,6 +49,7 @@
    class TypedFunctionsWithoutTypedefs
  • runtimeType
  • Methods
  • +
  • getAComplexTypedef
  • getAFunctionReturningVoid
  • noSuchMethod
  • toString
  • diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/runtimeType.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/runtimeType.html index e114d56870..396376fbf4 100644 --- a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/runtimeType.html +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/runtimeType.html @@ -49,6 +49,7 @@
    class TypedFunctionsWithoutTypedefs
  • runtimeType
  • Methods
  • +
  • getAComplexTypedef
  • getAFunctionReturningVoid
  • noSuchMethod
  • toString
  • diff --git a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/toString.html b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/toString.html index 5e295bdb86..3323be9ccc 100644 --- a/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/toString.html +++ b/testing/test_package_docs/ex/TypedFunctionsWithoutTypedefs/toString.html @@ -49,6 +49,7 @@
    class TypedFunctionsWithoutTypedefs
  • runtimeType
  • Methods
  • +
  • getAComplexTypedef
  • getAFunctionReturningVoid
  • noSuchMethod
  • toString
  • diff --git a/testing/test_package_docs/ex/WithGeneric-class.html b/testing/test_package_docs/ex/WithGeneric-class.html index 7d25975c85..6548315b18 100644 --- a/testing/test_package_docs/ex/WithGeneric-class.html +++ b/testing/test_package_docs/ex/WithGeneric-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/WithGenericSub-class.html b/testing/test_package_docs/ex/WithGenericSub-class.html index 54711c9d70..88bf189932 100644 --- a/testing/test_package_docs/ex/WithGenericSub-class.html +++ b/testing/test_package_docs/ex/WithGenericSub-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/aComplexTypedef.html b/testing/test_package_docs/ex/aComplexTypedef.html new file mode 100644 index 0000000000..f77f2d10a6 --- /dev/null +++ b/testing/test_package_docs/ex/aComplexTypedef.html @@ -0,0 +1,143 @@ + + + + + + + + aComplexTypedef typedef - ex library - Dart API + + + + + + + + + + + + +
    + +
    + + +
    aComplexTypedef
    + +
    + +
    + + + +
    + +
    + Function(A1 A1 A1) + aComplexTypedef(A3 A3) +
    + +
    +

    Someone might do this some day.

    +
    + + +
    + + + +
    + +
    + + test_package 0.0.1 + + • + + cc license + + +
    + + + + + + + + + + + diff --git a/testing/test_package_docs/ex/aThingToDo-class.html b/testing/test_package_docs/ex/aThingToDo-class.html index 45f61502fc..207adab243 100644 --- a/testing/test_package_docs/ex/aThingToDo-class.html +++ b/testing/test_package_docs/ex/aThingToDo-class.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/deprecated-constant.html b/testing/test_package_docs/ex/deprecated-constant.html index e69c62b941..7e88707233 100644 --- a/testing/test_package_docs/ex/deprecated-constant.html +++ b/testing/test_package_docs/ex/deprecated-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/deprecatedField.html b/testing/test_package_docs/ex/deprecatedField.html index 58d5428d76..56786b8298 100644 --- a/testing/test_package_docs/ex/deprecatedField.html +++ b/testing/test_package_docs/ex/deprecatedField.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/deprecatedGetter.html b/testing/test_package_docs/ex/deprecatedGetter.html index dab7881ba9..c6a1098ec2 100644 --- a/testing/test_package_docs/ex/deprecatedGetter.html +++ b/testing/test_package_docs/ex/deprecatedGetter.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/deprecatedSetter.html b/testing/test_package_docs/ex/deprecatedSetter.html index 041da97147..293c5e94e4 100644 --- a/testing/test_package_docs/ex/deprecatedSetter.html +++ b/testing/test_package_docs/ex/deprecatedSetter.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/ex-library.html b/testing/test_package_docs/ex/ex-library.html index 27a0a476d9..4bd17d4c2a 100644 --- a/testing/test_package_docs/ex/ex-library.html +++ b/testing/test_package_docs/ex/ex-library.html @@ -400,6 +400,15 @@

    Enums

    Typedefs

    +
    + aComplexTypedef(A3 A3) + → Function(A1 A1 A1) + +
    +
    + Someone might do this some day. + +
    ParameterizedTypedef(T msg, int foo) → String @@ -507,6 +516,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/function1.html b/testing/test_package_docs/ex/function1.html index 0ace605eb7..6136e635db 100644 --- a/testing/test_package_docs/ex/function1.html +++ b/testing/test_package_docs/ex/function1.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/genericFunction.html b/testing/test_package_docs/ex/genericFunction.html index ad10a5d673..fd9b5f922f 100644 --- a/testing/test_package_docs/ex/genericFunction.html +++ b/testing/test_package_docs/ex/genericFunction.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/incorrectDocReference-constant.html b/testing/test_package_docs/ex/incorrectDocReference-constant.html index e4bca5125e..a1f2efccdd 100644 --- a/testing/test_package_docs/ex/incorrectDocReference-constant.html +++ b/testing/test_package_docs/ex/incorrectDocReference-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/incorrectDocReferenceFromEx-constant.html b/testing/test_package_docs/ex/incorrectDocReferenceFromEx-constant.html index 804895f786..15abb3c857 100644 --- a/testing/test_package_docs/ex/incorrectDocReferenceFromEx-constant.html +++ b/testing/test_package_docs/ex/incorrectDocReferenceFromEx-constant.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/number.html b/testing/test_package_docs/ex/number.html index 96cc7f5d63..e28d3f55a6 100644 --- a/testing/test_package_docs/ex/number.html +++ b/testing/test_package_docs/ex/number.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/processMessage.html b/testing/test_package_docs/ex/processMessage.html index f6c596e866..9258094f5a 100644 --- a/testing/test_package_docs/ex/processMessage.html +++ b/testing/test_package_docs/ex/processMessage.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/ex/y.html b/testing/test_package_docs/ex/y.html index a0af0dc687..9dd415398b 100644 --- a/testing/test_package_docs/ex/y.html +++ b/testing/test_package_docs/ex/y.html @@ -88,6 +88,7 @@
    library ex
  • Animal
  • Typedefs
  • +
  • aComplexTypedef
  • ParameterizedTypedef
  • processMessage
  • diff --git a/testing/test_package_docs/index.json b/testing/test_package_docs/index.json index 4a27e9edf4..6a4afcd845 100644 --- a/testing/test_package_docs/index.json +++ b/testing/test_package_docs/index.json @@ -2740,6 +2740,17 @@ "type": "class" } }, + { + "name": "getAComplexTypedef", + "qualifiedName": "ex.TypedFunctionsWithoutTypedefs.getAComplexTypedef", + "href": "ex/TypedFunctionsWithoutTypedefs/getAComplexTypedef.html", + "type": "method", + "overriddenDepth": 0, + "enclosedBy": { + "name": "TypedFunctionsWithoutTypedefs", + "type": "class" + } + }, { "name": "getAFunctionReturningVoid", "qualifiedName": "ex.TypedFunctionsWithoutTypedefs.getAFunctionReturningVoid", @@ -2905,6 +2916,17 @@ "type": "class" } }, + { + "name": "aComplexTypedef", + "qualifiedName": "ex.aComplexTypedef", + "href": "ex/aComplexTypedef.html", + "type": "typedef", + "overriddenDepth": 0, + "enclosedBy": { + "name": "ex", + "type": "library" + } + }, { "name": "aThingToDo", "qualifiedName": "ex.aThingToDo", From dd7cf66e97ed37c3889a28ea88133e14e914210d Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 27 Sep 2017 13:34:40 -0700 Subject: [PATCH 03/18] dartfmt --- lib/src/html/template_data.dart | 3 ++- lib/src/model.dart | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/src/html/template_data.dart b/lib/src/html/template_data.dart index af09c560f1..e14b6e6320 100644 --- a/lib/src/html/template_data.dart +++ b/lib/src/html/template_data.dart @@ -180,7 +180,8 @@ class ClassTemplateData extends TemplateData { '${library.name} library, for the Dart programming language.'; @override - String get layoutTitle => _layoutTitle(clazz.nameWithGenerics, clazz.fullkind, clazz.isDeprecated); + String get layoutTitle => + _layoutTitle(clazz.nameWithGenerics, clazz.fullkind, clazz.isDeprecated); @override List get navLinks => [package, library]; @override diff --git a/lib/src/model.dart b/lib/src/model.dart index f70aa4d505..0ff084f335 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -3230,7 +3230,6 @@ class ModelFunction extends ModelFunctionTyped { FunctionElement get _func => (element as FunctionElement); } - /// A [ModelElement] for a [GenericModelFunctionElement] that is not an /// explicit typedef. /// @@ -3258,8 +3257,7 @@ class ModelFunctionTypedef extends ModelFunctionTyped { String get name { Element e = element; while (e != null) { - if (e is FunctionTypeAliasElement) - return e.name; + if (e is FunctionTypeAliasElement) return e.name; e = e.enclosingElement; } assert(false); From 6040a09ce0d8e17bc5eab3ab94bb39e1c4fbaa87 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 27 Sep 2017 13:55:35 -0700 Subject: [PATCH 04/18] Move constructor logic to a more logical place --- lib/src/model.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/src/model.dart b/lib/src/model.dart index 0ff084f335..0360fd0972 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -2216,6 +2216,14 @@ abstract class ModelElement extends Nameable } if (e is FunctionElement) { newModelElement = new ModelFunction(e, library); + } else if (e is GenericFunctionTypeElement) { + if (e is FunctionTypeAliasElement) { + assert(e.name != ''); + newModelElement = new ModelFunctionTypedef(e, library); + } else { + assert(e.name == ''); + newModelElement = new ModelFunctionAnonymous(e, library); + } } if (e is FunctionTypeAliasElement) { newModelElement = new Typedef(e, library); @@ -2286,15 +2294,6 @@ abstract class ModelElement extends Nameable } } - if (e is GenericFunctionTypeElement) { - if (e is FunctionTypeAliasElement) { - assert(e.name != ''); - newModelElement = new ModelFunctionTypedef(e, library); - } else { - assert(e.name == ''); - newModelElement = new ModelFunctionAnonymous(e, library); - } - } if (newModelElement == null) throw "Unknown type ${e.runtimeType}"; if (enclosingClass != null) assert(newModelElement is Inheritable); From b79efa20f68e3a0c2f22fb48eb056960b83f9b8a Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 27 Sep 2017 14:16:21 -0700 Subject: [PATCH 05/18] Make AppVeyor run pub get for the test package as well to regenerate .packages --- appveyor.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 02aa2e5cc4..ce1c4db152 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,6 +9,11 @@ install: - set PATH=%PATH%;C:\tools\dart-sdk\bin - set PATH=%PATH%;%APPDATA%\Pub\Cache\bin - pub get + - cmd: cd testing + - cmd: cd test_package + - cmd: pub get + - cmd: cd .. + - cmd: cd .. build: off From 05ddca020be7badeff33bdbcecf1782da849f3a7 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Wed, 27 Sep 2017 14:38:39 -0700 Subject: [PATCH 06/18] Doc update --- lib/src/model.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/model.dart b/lib/src/model.dart index 0360fd0972..76a595bcb4 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -3208,7 +3208,7 @@ abstract class ModelElement extends Nameable } } -/// A ModelElement for a FunctionElement that isn't part of a type definition. +/// A [ModelElement] for a [FunctionElement] that isn't part of a type definition. class ModelFunction extends ModelFunctionTyped { ModelFunction(FunctionElement element, Library library) : super(element, library); @@ -3229,12 +3229,12 @@ class ModelFunction extends ModelFunctionTyped { FunctionElement get _func => (element as FunctionElement); } -/// A [ModelElement] for a [GenericModelFunctionElement] that is not an +/// A [ModelElement] for a [GenericModelFunctionElement] that is an /// explicit typedef. /// /// Distinct from ModelFunctionTypedef in that it doesn't /// have a name, but we document it as "Function" to match how these are -/// written in method declarations. +/// written in declarations. class ModelFunctionAnonymous extends ModelFunctionTyped { ModelFunctionAnonymous(FunctionTypedElement element, Library library) : super(element, library) {} @@ -3246,7 +3246,7 @@ class ModelFunctionAnonymous extends ModelFunctionTyped { bool get isPublic => false; } -/// A ModelElement for a GenericModelFunctionElement that may be part of an +/// A [ModelElement] for a [GenericModelFunctionElement] that is part of an /// explicit typedef. class ModelFunctionTypedef extends ModelFunctionTyped { ModelFunctionTypedef(FunctionTypedElement element, Library library) From 609611331e58decd0a7371e4795e6e7f8f3d236e Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 08:26:13 -0700 Subject: [PATCH 07/18] appveyor experiment --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index ce1c4db152..b97a9f0266 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,9 @@ install: - pub get - cmd: cd testing - cmd: cd test_package + - cmd: type .packages - cmd: pub get + - cmd: type .packages - cmd: cd .. - cmd: cd .. From 95807433961ce183b45f849545779238d15b56bc Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 08:38:34 -0700 Subject: [PATCH 08/18] appveyor experiment 2 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b97a9f0266..c82b55a1ee 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ install: - pub get - cmd: cd testing - cmd: cd test_package - - cmd: type .packages + - cmd: dir /a - cmd: pub get - cmd: type .packages - cmd: cd .. From f21a28b5083a930fd5a8192ae91f516913972c9e Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 09:48:26 -0700 Subject: [PATCH 09/18] appveyor experiment #3 --- appveyor.yml | 7 ------- pubspec.lock | 10 ++++++++-- pubspec.yaml | 2 ++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c82b55a1ee..02aa2e5cc4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,13 +9,6 @@ install: - set PATH=%PATH%;C:\tools\dart-sdk\bin - set PATH=%PATH%;%APPDATA%\Pub\Cache\bin - pub get - - cmd: cd testing - - cmd: cd test_package - - cmd: dir /a - - cmd: pub get - - cmd: type .packages - - cmd: cd .. - - cmd: cd .. build: off diff --git a/pubspec.lock b/pubspec.lock index 06b731f26a..08654c5ed4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -306,7 +306,13 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "0.12.24+6" + version: "0.12.24" + test_package_imported: + description: + path: "testing/test_package_imported" + relative: true + source: path + version: "0.0.1" tuple: description: name: tuple @@ -362,4 +368,4 @@ packages: source: hosted version: "2.1.12" sdks: - dart: ">=1.23.0 <=2.0.0-dev.1.0" + dart: ">=1.23.0 <=2.0.0-edge.ac9ff3f3afb8b5c8f6173781aa4d282b9cec6d05" diff --git a/pubspec.yaml b/pubspec.yaml index 0d5ce9a92d..3c277c7fe5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,5 +29,7 @@ dev_dependencies: meta: ^1.0.0 pub_semver: ^1.0.0 test: '>=0.12.20+24 <0.13.0' + test_package_imported: + path: 'testing/test_package_imported' executables: dartdoc: null From 7c57b80579307a02d70b0f349dcfdfc0f2dcef18 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 10:12:43 -0700 Subject: [PATCH 10/18] update pubspec.locks --- testing/test_package_bad/pubspec.lock | 5 +++++ testing/test_package_small/pubspec.lock | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 testing/test_package_bad/pubspec.lock create mode 100644 testing/test_package_small/pubspec.lock diff --git a/testing/test_package_bad/pubspec.lock b/testing/test_package_bad/pubspec.lock new file mode 100644 index 0000000000..c427295339 --- /dev/null +++ b/testing/test_package_bad/pubspec.lock @@ -0,0 +1,5 @@ +# Generated by pub +# See http://pub.dartlang.org/doc/glossary.html#lockfile +packages: {} +sdks: + dart: any diff --git a/testing/test_package_small/pubspec.lock b/testing/test_package_small/pubspec.lock new file mode 100644 index 0000000000..c427295339 --- /dev/null +++ b/testing/test_package_small/pubspec.lock @@ -0,0 +1,5 @@ +# Generated by pub +# See http://pub.dartlang.org/doc/glossary.html#lockfile +packages: {} +sdks: + dart: any From 071b19960eb69d1e35ea6c68634a175b6e784c0c Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 13:38:12 -0700 Subject: [PATCH 11/18] Fix private detection to include dart:_ prefix --- lib/src/model_utils.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/model_utils.dart b/lib/src/model_utils.dart index 66e2739e0d..ef809d98b2 100644 --- a/lib/src/model_utils.dart +++ b/lib/src/model_utils.dart @@ -54,12 +54,14 @@ bool isInExportedLibraries( final RegExp slashes = new RegExp('[\/]'); bool hasPrivateName(Element e) { - if (e.name.startsWith('_') || - (e is LibraryElement && - (e.identifier == 'dart:_internal' || - e.identifier == 'dart:nativewrappers'))) { + if (e.name.startsWith('_')) { return true; } + if (e is LibraryElement && + (e.identifier.startsWith('dart:_') || + ['dart:nativewrappers'].contains(e.identifier))) { + return true; + } if (e is LibraryElement) { List locationParts = e.location.components[0].split(slashes); // TODO(jcollins-g): Implement real cross package detection From 386c8a368eae64decc6f0046be1b895df009696e Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 14:03:36 -0700 Subject: [PATCH 12/18] travis experiment --- tool/travis.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tool/travis.sh b/tool/travis.sh index 580ce2c50d..c03246f1e2 100755 --- a/tool/travis.sh +++ b/tool/travis.sh @@ -37,6 +37,8 @@ elif [ "$DARTDOC_BOT" = "flutter" ]; then ./bin/flutter --version ./bin/flutter precache ( cd dev/tools; pub get ) + ls -lt pubspec.* + ls -lt dev/tools/pubspec.* ./bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart # The above script validates the generation; we echo the main file here. From 2f16d264e48915d6b81658f56ccd5f822861bb7e Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 14:07:08 -0700 Subject: [PATCH 13/18] travis experiment 2 --- tool/travis.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tool/travis.sh b/tool/travis.sh index c03246f1e2..3a9ed21b7f 100755 --- a/tool/travis.sh +++ b/tool/travis.sh @@ -37,9 +37,10 @@ elif [ "$DARTDOC_BOT" = "flutter" ]; then ./bin/flutter --version ./bin/flutter precache ( cd dev/tools; pub get ) + set +e ls -lt pubspec.* ls -lt dev/tools/pubspec.* - ./bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart + ./bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart || exit $? # The above script validates the generation; we echo the main file here. cat dev/docs/doc/index.html From 588dc93e8878c6ce45c113e91414ec48d4598f77 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 14:10:39 -0700 Subject: [PATCH 14/18] travis experiment 3 --- tool/travis.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tool/travis.sh b/tool/travis.sh index 3a9ed21b7f..61f20ef2f8 100755 --- a/tool/travis.sh +++ b/tool/travis.sh @@ -23,10 +23,10 @@ elif [ "$DARTDOC_BOT" = "flutter" ]; then echo "Running flutter dartdoc bot" # Verify that the libraries are error free. - pub run grinder analyze + ./bin/cache/dart-sdk/bin/pub run grinder analyze # Set up dartdoc so the flutter doc script can locate it. - pub global activate -spath . + ./bin/cache/dart-sdk/bin/pub global activate -spath . # Clone flutter. rm -rf doc/flutter @@ -38,7 +38,7 @@ elif [ "$DARTDOC_BOT" = "flutter" ]; then ./bin/flutter precache ( cd dev/tools; pub get ) set +e - ls -lt pubspec.* + ls -lt ../../pubspec.* ls -lt dev/tools/pubspec.* ./bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart || exit $? From 7c9829766742d103e446536ae8f21b0a0fd69a4b Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Mon, 2 Oct 2017 08:03:03 -0700 Subject: [PATCH 15/18] Reset to 05ddca020be7badeff33bdbcecf1782da849f3a7 --- appveyor.yml | 5 +++++ lib/src/model_utils.dart | 10 ++++------ pubspec.lock | 10 ++-------- pubspec.yaml | 2 -- testing/test_package_bad/pubspec.lock | 5 ----- testing/test_package_small/pubspec.lock | 5 ----- tool/travis.sh | 9 +++------ 7 files changed, 14 insertions(+), 32 deletions(-) delete mode 100644 testing/test_package_bad/pubspec.lock delete mode 100644 testing/test_package_small/pubspec.lock diff --git a/appveyor.yml b/appveyor.yml index 02aa2e5cc4..ce1c4db152 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,6 +9,11 @@ install: - set PATH=%PATH%;C:\tools\dart-sdk\bin - set PATH=%PATH%;%APPDATA%\Pub\Cache\bin - pub get + - cmd: cd testing + - cmd: cd test_package + - cmd: pub get + - cmd: cd .. + - cmd: cd .. build: off diff --git a/lib/src/model_utils.dart b/lib/src/model_utils.dart index ef809d98b2..66e2739e0d 100644 --- a/lib/src/model_utils.dart +++ b/lib/src/model_utils.dart @@ -54,14 +54,12 @@ bool isInExportedLibraries( final RegExp slashes = new RegExp('[\/]'); bool hasPrivateName(Element e) { - if (e.name.startsWith('_')) { + if (e.name.startsWith('_') || + (e is LibraryElement && + (e.identifier == 'dart:_internal' || + e.identifier == 'dart:nativewrappers'))) { return true; } - if (e is LibraryElement && - (e.identifier.startsWith('dart:_') || - ['dart:nativewrappers'].contains(e.identifier))) { - return true; - } if (e is LibraryElement) { List locationParts = e.location.components[0].split(slashes); // TODO(jcollins-g): Implement real cross package detection diff --git a/pubspec.lock b/pubspec.lock index 08654c5ed4..06b731f26a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -306,13 +306,7 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "0.12.24" - test_package_imported: - description: - path: "testing/test_package_imported" - relative: true - source: path - version: "0.0.1" + version: "0.12.24+6" tuple: description: name: tuple @@ -368,4 +362,4 @@ packages: source: hosted version: "2.1.12" sdks: - dart: ">=1.23.0 <=2.0.0-edge.ac9ff3f3afb8b5c8f6173781aa4d282b9cec6d05" + dart: ">=1.23.0 <=2.0.0-dev.1.0" diff --git a/pubspec.yaml b/pubspec.yaml index 3c277c7fe5..0d5ce9a92d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,7 +29,5 @@ dev_dependencies: meta: ^1.0.0 pub_semver: ^1.0.0 test: '>=0.12.20+24 <0.13.0' - test_package_imported: - path: 'testing/test_package_imported' executables: dartdoc: null diff --git a/testing/test_package_bad/pubspec.lock b/testing/test_package_bad/pubspec.lock deleted file mode 100644 index c427295339..0000000000 --- a/testing/test_package_bad/pubspec.lock +++ /dev/null @@ -1,5 +0,0 @@ -# Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile -packages: {} -sdks: - dart: any diff --git a/testing/test_package_small/pubspec.lock b/testing/test_package_small/pubspec.lock deleted file mode 100644 index c427295339..0000000000 --- a/testing/test_package_small/pubspec.lock +++ /dev/null @@ -1,5 +0,0 @@ -# Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile -packages: {} -sdks: - dart: any diff --git a/tool/travis.sh b/tool/travis.sh index 61f20ef2f8..580ce2c50d 100755 --- a/tool/travis.sh +++ b/tool/travis.sh @@ -23,10 +23,10 @@ elif [ "$DARTDOC_BOT" = "flutter" ]; then echo "Running flutter dartdoc bot" # Verify that the libraries are error free. - ./bin/cache/dart-sdk/bin/pub run grinder analyze + pub run grinder analyze # Set up dartdoc so the flutter doc script can locate it. - ./bin/cache/dart-sdk/bin/pub global activate -spath . + pub global activate -spath . # Clone flutter. rm -rf doc/flutter @@ -37,10 +37,7 @@ elif [ "$DARTDOC_BOT" = "flutter" ]; then ./bin/flutter --version ./bin/flutter precache ( cd dev/tools; pub get ) - set +e - ls -lt ../../pubspec.* - ls -lt dev/tools/pubspec.* - ./bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart || exit $? + ./bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart # The above script validates the generation; we echo the main file here. cat dev/docs/doc/index.html From dedf6177e3f416a1141b309ae6c77a5d06671078 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Fri, 29 Sep 2017 13:38:12 -0700 Subject: [PATCH 16/18] Fix private detection to include dart:_ prefix --- lib/src/model_utils.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/src/model_utils.dart b/lib/src/model_utils.dart index 66e2739e0d..ef809d98b2 100644 --- a/lib/src/model_utils.dart +++ b/lib/src/model_utils.dart @@ -54,12 +54,14 @@ bool isInExportedLibraries( final RegExp slashes = new RegExp('[\/]'); bool hasPrivateName(Element e) { - if (e.name.startsWith('_') || - (e is LibraryElement && - (e.identifier == 'dart:_internal' || - e.identifier == 'dart:nativewrappers'))) { + if (e.name.startsWith('_')) { return true; } + if (e is LibraryElement && + (e.identifier.startsWith('dart:_') || + ['dart:nativewrappers'].contains(e.identifier))) { + return true; + } if (e is LibraryElement) { List locationParts = e.location.components[0].split(slashes); // TODO(jcollins-g): Implement real cross package detection From c22ce9b21ad4f76ff4456eb71a58e2a3037e7a52 Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Mon, 2 Oct 2017 08:23:03 -0700 Subject: [PATCH 17/18] Review comments --- pubspec.lock | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 06b731f26a..37168660d3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -362,4 +362,4 @@ packages: source: hosted version: "2.1.12" sdks: - dart: ">=1.23.0 <=2.0.0-dev.1.0" + dart: ">=1.23.0 <=2.0.0-dev.2.0" diff --git a/pubspec.yaml b/pubspec.yaml index 0d5ce9a92d..fa254b46be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,6 @@ dev_dependencies: http: ^0.11.0 meta: ^1.0.0 pub_semver: ^1.0.0 - test: '>=0.12.20+24 <0.13.0' + test: '^0.12.20+24 <0.13.0' executables: dartdoc: null From 11573b7e1604af90756723c431bcd42c4c3a7eae Mon Sep 17 00:00:00 2001 From: Janice Collins Date: Mon, 2 Oct 2017 08:26:33 -0700 Subject: [PATCH 18/18] typo --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index fa254b46be..826af267ab 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,6 @@ dev_dependencies: http: ^0.11.0 meta: ^1.0.0 pub_semver: ^1.0.0 - test: '^0.12.20+24 <0.13.0' + test: '^0.12.20+24' executables: dartdoc: null