Inspectopedia
 
2024.3

Explicit types

Info
Code Style
New
Last modified: 03 December 2024

Reports a type annotation that doesn't match the current code style for explicit types.

Type declarations are not necessary when the type that is inferred from the context exactly matches the type annotation, for example:

In some cases it is preferable to always have explicit types - this prevents accidental type changes and makes code more explicit.