Implicit type conversion
Reports implicit conversions between the predefined XPath-types STRING, NUMBER, BOOLEAN, and NODESET. Helps to write XSLT scripts that are more expressive about types and prevents subtle bugs:
Example:
<xsl:if test="foo" />is not the same as
<xsl:if test="string(foo)" />The first test checks whether the element "foo" exists (count(foo) > 0); the latter one however is only true if the element actually contains any text (string-length(foo) > 0). Suggests making the type conversion more explicit.
Use the following options to configure the inspection:
Enable or disable implicit conversions between certain types
Always report explicit conversions that do not result in the actually expected type, for example,
<xsl:if test="number(foo)" />Ignore conversion from
NODESETtoBOOLEANby using thestring()function as a shortcut for writingstring-length() > 0.
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
ImplicitTypeConversion
Inspection ID: ImplicitTypeConversion
Here you can find the description of settings available for the Implicit type conversion inspection, and the reference of their default values.
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
//noinspection ImplicitTypeConversionnote
Actual comment syntax will depend on the code language you are working with
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: | CLion 2025.2, DataGrip 2025.2, IntelliJ IDEA 2025.2, JetBrains Rider 2025.2, PhpStorm 2025.2, Qodana for .NET 2025.2, Qodana for JVM 2025.2, Qodana for PHP 2025.2, |