@@ -41,14 +41,13 @@ class GenericFunctionType implements SupportedFunctionType {
41
41
String get typedefName => _typedefName;
42
42
43
43
@override
44
- String get typeDescription => _functionTypeAliasElement.aliasedElement
44
+ String get typeDescription => _functionTypeAliasElement.aliasedElement!
45
45
.getDisplayString (withNullability: false );
46
46
47
47
final TypeAliasElement _functionTypeAliasElement;
48
48
final bool _withContext;
49
49
50
- GenericFunctionType ._(this ._functionTypeAliasElement, this ._withContext)
51
- : assert (_functionTypeAliasElement != null );
50
+ GenericFunctionType ._(this ._functionTypeAliasElement, this ._withContext);
52
51
53
52
static Future <GenericFunctionType > create (Resolver resolver) async {
54
53
final lib = await resolver.libraryFor (AssetId .resolve (_libraryUri));
@@ -71,7 +70,7 @@ class GenericFunctionType implements SupportedFunctionType {
71
70
}
72
71
73
72
@override
74
- FactoryData createReference (
73
+ FactoryData ? createReference (
75
74
LibraryElement library,
76
75
String targetName,
77
76
FunctionElement element,
@@ -101,11 +100,11 @@ class GenericFunctionType implements SupportedFunctionType {
101
100
102
101
if (library.typeSystem.isSubtypeOf (element.type, functionType)) {
103
102
if (paramInfo.paramType != null ) {
104
- if (library.exportNamespace.get (paramInfo.paramType.element.name) ==
103
+ if (library.exportNamespace.get (paramInfo.paramType! .element.name) ==
105
104
null ) {
106
105
// TODO: add a test for this!
107
106
throw InvalidGenerationSourceError (
108
- 'The type `${paramInfo .paramType .element .name }` is not exposed by '
107
+ 'The type `${paramInfo .paramType ! .element .name }` is not exposed by '
109
108
'the function library `${library .source .uri }` so it cannot '
110
109
'be used.' ,
111
110
);
@@ -152,7 +151,7 @@ class _GenericFactoryData implements FactoryData {
152
151
final typeDisplayName = info.paramType == null
153
152
? jsonTypeDisplay
154
153
: '$functionsLibraryPrefix .'
155
- '${info .paramType .getDisplayString (withNullability : false )}' ;
154
+ '${info .paramType ! .getDisplayString (withNullability : false )}' ;
156
155
157
156
final returnBlock = info.paramType == null
158
157
? 'return $_jsonParamName ;'
0 commit comments