"Inapplicable operator modifier" and "Inapplicable infix modifier" are now errors

This commit is contained in:
Yan Zhulanow
2015-12-25 18:35:02 +03:00
parent f560799bb7
commit 3fa506fd45
67 changed files with 56 additions and 347 deletions
@@ -960,6 +960,7 @@ public fun CharSequence.lastIndexOf(string: String, startIndex: Int = lastIndex,
*
* @param ignoreCase `true` to ignore character case when comparing strings. By default `false`.
*/
@Suppress("INAPPLICABLE_OPERATOR_MODIFIER")
public operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boolean = false): Boolean =
if (other is String)
indexOf(other, ignoreCase = ignoreCase) >= 0
@@ -973,6 +974,7 @@ public operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boole
*
* @param ignoreCase `true` to ignore character case when comparing characters. By default `false`.
*/
@Suppress("INAPPLICABLE_OPERATOR_MODIFIER")
public operator fun CharSequence.contains(char: Char, ignoreCase: Boolean = false): Boolean =
indexOf(char, ignoreCase = ignoreCase) >= 0