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));
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。