Deprecate mixed Int/FP contains operator for ranges

#KT-22423
This commit is contained in:
Ilya Gorbunov
2018-09-10 03:34:29 +03:00
parent 68c5c0f639
commit 48add96e79
3 changed files with 49 additions and 17 deletions
@@ -160,6 +160,9 @@ object RangeOps : TemplateGroupBase() {
signature("contains(value: $itemType)")
check(rangeType.isNumeric() == itemType.isNumeric()) { "Required rangeType and itemType both to be numeric or both not, got: $rangeType, $itemType" }
if (rangeType.isIntegral() != itemType.isIntegral()) {
deprecate(Deprecation("This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.", level = DeprecationLevel.WARNING))
}
platformName("${rangeType.name.decapitalize()}RangeContains")
returns("Boolean")
doc { "Checks if the specified [value] belongs to this range." }