Skip to content

Commit

Permalink
Comments and type cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollins-g committed Jun 3, 2021
1 parent 04334b2 commit 2a440a0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/src/element_type.dart
Expand Up @@ -54,8 +54,13 @@ abstract class ElementType extends Privacy with CommentReferable, Nameable {
var isGenericTypeAlias = f.aliasElement != null && f is! InterfaceType;
if (f is FunctionType) {
assert(f is ParameterizedType);
// This is an indication we have an extremely out of date analyzer....
assert(
!isGenericTypeAlias, 'should never occur: out of date analyzer?');
// And finally, delete this case and its associated class
// after https://dart-review.googlesource.com/c/sdk/+/201520
// is in all published versions of analyzer this version of dartdoc
// is compatible with.
return CallableElementType(
f, library, packageGraph, element, returnedFrom);
} else if (isGenericTypeAlias) {
Expand Down Expand Up @@ -158,7 +163,7 @@ class UndefinedElementType extends ElementType {
/// A FunctionType that does not have an underpinning Element.
class FunctionTypeElementType extends UndefinedElementType
with Rendered, Callable {
FunctionTypeElementType(DartType f, Library library,
FunctionTypeElementType(FunctionType f, Library library,
PackageGraph packageGraph, ElementType returnedFrom)
: super(f, library, packageGraph, returnedFrom);

Expand All @@ -177,9 +182,12 @@ class FunctionTypeElementType extends UndefinedElementType

class AliasedFunctionTypeElementType extends FunctionTypeElementType
with Aliased {
AliasedFunctionTypeElementType(DartType f, Library library,
AliasedFunctionTypeElementType(FunctionType f, Library library,
PackageGraph packageGraph, ElementType returnedFrom)
: super(f, library, packageGraph, returnedFrom);
: super(f, library, packageGraph, returnedFrom) {
assert(type.aliasElement != null);
assert(type.aliasArguments != null);
}

@override
ElementTypeRenderer<AliasedFunctionTypeElementType> get _renderer =>
Expand Down

0 comments on commit 2a440a0

Please sign in to comment.