no_raw_types
Details about the 'no_raw_types' diagnostic produced by the Dart analyzer.
The generic type '{0}' should have explicit type arguments but doesn't.
Description
#The analyzer produces this diagnostic when a generic type is used without explicit type arguments, meaning it is a raw type.
Example
#
The following code produces this diagnostic because the generic class C
is used without a type argument:
dart
class C<T> {}
C c = C<int>();
Common fixes
#Provide explicit type arguments:
dart
class C<T> {}
C<int> c = C<int>();
Was this page's content helpful?
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.