invalid_inline_function_type
Inline function types can't be used for parameters in a generic function type.
Description
#The analyzer produces this diagnostic when a generic function type has a function-valued parameter that is written using the older inline function type syntax.
Example
#The following code produces this diagnostic because the parameter f
, in the generic function type used to define F
, uses the inline function type syntax:
dart
typedef F = int Function(int f(String s));
Common fixes
#Use the generic function syntax for the parameter's type:
dart
typedef F = int Function(int Function(String));
Was this page's content helpful?
Thank you for your feedback!
Provide details Thank you for your feedback! Please let us know what we can do to improve.
Provide details Unless stated otherwise, the documentation on this site reflects Dart 3.8.1. Page last updated on 2025-05-08. View source or report an issue.