Drop identityEquals from builtins, compiler and tests.

This commit is contained in:
Ilya Gorbunov
2016-01-21 19:40:46 +03:00
parent f5f5a2dcc1
commit 4d5ec9be3f
44 changed files with 66 additions and 185 deletions
@@ -32,7 +32,6 @@ val ALL_SEARCHABLE_OPERATIONS: ImmutableSet<KtToken> = ImmutableSet
.addAll(ASSIGNMENT_OPERATIONS.keys)
.addAll(COMPARISON_OPERATIONS)
.addAll(EQUALS_OPERATIONS)
.addAll(IDENTITY_EQUALS_OPERATIONS)
.addAll(IN_OPERATIONS)
.add(KtTokens.LBRACKET)
.add(KtTokens.BY_KEYWORD)
@@ -50,7 +49,6 @@ fun Name.getOperationSymbolsToSearch(): Set<KtToken> {
when (this) {
OperatorNameConventions.COMPARE_TO -> return COMPARISON_OPERATIONS_TO_SEARCH
OperatorNameConventions.EQUALS -> return EQUALS_OPERATIONS
OperatorNameConventions.IDENTITY_EQUALS -> return IDENTITY_EQUALS_OPERATIONS
OperatorNameConventions.CONTAINS -> return IN_OPERATIONS_TO_SEARCH
OperatorNameConventions.ITERATOR -> return IN_OPERATIONS_TO_SEARCH
in INDEXING_OPERATION_NAMES -> return setOf(KtTokens.LBRACKET)
@@ -32,7 +32,7 @@ class SwapBinaryExpressionIntention : SelfTargetingIntention<KtBinaryExpression>
private val SUPPORTED_OPERATIONS = setOf(PLUS, MUL, OROR, ANDAND, EQEQ, EXCLEQ, EQEQEQ, EXCLEQEQEQ, GT, LT, GTEQ, LTEQ)
private val SUPPORTED_OPERATION_NAMES = SUPPORTED_OPERATIONS.mapNotNull { OperatorConventions.BINARY_OPERATION_NAMES[it]?.asString() }.toSet() +
setOf("xor", "or", "and", "equals", "identityEquals")
setOf("xor", "or", "and", "equals")
}
override fun isApplicableTo(element: KtBinaryExpression, caretOffset: Int): Boolean {
@@ -1,16 +0,0 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtNamedFunction
// OPTIONS: usages
// FIND_BY_REF
class A(val n: Int) {
override fun equals(other: Any?): Boolean = other is A && other.n == n
}
fun test() {
A(0) == A(1)
A(0) != A(1)
A(0) equals A(1)
A(0) <caret>identityEquals A(1)
A(0) === A(1)
A(0) !== A(1)
}
@@ -1,3 +0,0 @@
Function call (13: 10) A(0) identityEquals A(1)
Function call (14: 10) A(0) === A(1)
Function call (15: 10) A(0) !== A(1)
-2
View File
@@ -16,8 +16,6 @@ fun foo() {
oldFun1(oldFun2(10))
oldFun2()
1.identityEquals(2)
}
fun unnecessarySafeCall(x: String) {
-2
View File
@@ -15,8 +15,6 @@ fun foo() {
bar(bar(10 + 2) + 1)
oldFun2()
1 === 2
}
fun unnecessarySafeCall(x: String) {
@@ -126,12 +126,6 @@ public class FindUsagesTestGenerated extends AbstractFindUsagesTest {
doTest(fileName);
}
@TestMetadata("identityEquals.0.kt")
public void testIdentityEquals() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/conventions/identityEquals.0.kt");
doTest(fileName);
}
@TestMetadata("inc.0.kt")
public void testInc() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/conventions/inc.0.kt");