Skip to content

ObsoleteTypeHintInspection

Max Dörner edited this page Jun 2, 2019 · 3 revisions

Description: Use of obsolete type hints in identifier

Type: CodeInspectionType.LanguageOpportunities

Default severity: CodeInspectionSeverity.Hint

This inspection finds declarations that specify the type using a type hint character. These type hints are seldom encountered, and have been replaced with As type clauses, which explicitly specify an identifier's type by its name. Using type hints hinder readability and maintainability, because unless the maintainer knows what type a type hint character stands for, a variable's type must be looked up.

Example:

The type of foo is String, because type hint $ specifies a String:

Dim foo$

This code is unnecessarily obfuscated. Unless the maintainer knows what the type hint characters are and what type they stand for, one would have to lookup the type hint or locate usages of foo to know what its type is.


QuickFixes

This inspection has no quickfix implemented in version 1.2; future versions may include one.

Clone this wiki locally