KT-26629 Inspection to replace equality check with NaN with isNaN call
This commit is contained in:
committed by
Mikhail Glukhikh
parent
07e908f15f
commit
574178882a
@@ -2368,6 +2368,15 @@
|
||||
language="kotlin"
|
||||
/>
|
||||
|
||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.ConvertNaNEqualityInspection"
|
||||
displayName="Convert equality check with 'NaN' to 'isNaN' call"
|
||||
groupPath="Kotlin"
|
||||
groupName="Probable bugs"
|
||||
enabledByDefault="true"
|
||||
level="WARNING"
|
||||
language="kotlin"
|
||||
/>
|
||||
|
||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.UnusedEqualsInspection"
|
||||
displayName="Unused equals expression"
|
||||
groupPath="Kotlin"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
This inspection reports an equality check with <b>Double.NaN</b> which can be replaced with <b>a.isNaN()</b>.
|
||||
|
||||
For every floating point value <b>a</b>, <b>a == NaN</b> will always result in <b>false</b>.
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user