File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ class DecoratedType {
136136 /// nodes everywhere that don't correspond to any source location. These
137137 /// nodes can later be unioned with other nodes.
138138 factory DecoratedType .forImplicitType (DartType type, NullabilityGraph graph) {
139- if (type.isDynamic) {
139+ if (type.isDynamic || type.isVoid ) {
140140 return DecoratedType (type, graph.always);
141141 } else if (type is InterfaceType ) {
142142 return DecoratedType (type, NullabilityNode .forInferredType (),
Original file line number Diff line number Diff line change @@ -421,6 +421,24 @@ void f(C x) {}
421421 expect (decoratedArgReturnType.typeArguments, isEmpty);
422422 }
423423
424+ test_interfaceType_generic_instantiate_to_function_type_void () async {
425+ await analyze ('''
426+ class C<T extends void Function()> {}
427+ void f(C x) {}
428+ ''' );
429+ var decoratedCType = decoratedTypeAnnotation ('C x' );
430+ expect (decoratedFunctionType ('f' ).positionalParameters[0 ],
431+ same (decoratedCType));
432+ expect (decoratedCType.node, TypeMatcher <NullabilityNodeMutable >());
433+ expect (decoratedCType.typeArguments, hasLength (1 ));
434+ var decoratedArgType = decoratedCType.typeArguments[0 ];
435+ expect (decoratedArgType.node, TypeMatcher <NullabilityNodeMutable >());
436+ expect (decoratedArgType.typeArguments, isEmpty);
437+ var decoratedArgReturnType = decoratedArgType.returnType;
438+ expect (decoratedArgReturnType.node, same (always));
439+ expect (decoratedArgReturnType.typeArguments, isEmpty);
440+ }
441+
424442 test_interfaceType_generic_instantiate_to_generic_type () async {
425443 await analyze ('''
426444class C<T> {}
You can’t perform that action at this time.
0 commit comments