Skip to main content

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>();