Fix 'equals' for NotNullBasicValue

NotNullBasicValues were merged incorrectly sometimes,
which caused problems with INSTANCEOF checks.

 #KT-18779 Fixed
This commit is contained in:
Dmitry Petrov
2017-07-03 14:08:15 +03:00
parent 8121c1d3c4
commit 16505daeea
6 changed files with 44 additions and 1 deletions
@@ -23,7 +23,7 @@ import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue
class NotNullBasicValue(type: Type?) : StrictBasicValue(type) {
override fun equals(other: Any?): Boolean = other is NotNullBasicValue
override fun equals(other: Any?): Boolean = other is NotNullBasicValue && other.type == type
// We do not differ not-nullable values, so we should always return the same hashCode
// Actually it doesn't really matter because analyzer is not supposed to store values in hashtables
override fun hashCode() = 0