deprecated_ subtype_ of_ function
Details about the 'deprecated_subtype_of_function' diagnostic produced by the Dart analyzer.
Extending 'Function' is deprecated.
Implementing 'Function' has no effect.
Mixing in 'Function' is deprecated.
Description
#
The analyzer produces this diagnostic when the class
Function is used in either the
extends, implements, or
with clause of a class or mixin. Using the class
Function in this way has no semantic value, so
it's effectively dead code.
Example
#
The following code produces this diagnostic because
Function is used as the superclass of
F:
class F extends Function {}
Common fixes
#
Remove the class Function from whichever clause
it's in, and remove the whole clause if
Function is the only type in the clause:
class F {}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.