From 84ca26719db53666242a53ede41e0e977cb44ee9 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Tue, 26 May 2015 19:04:07 +0300 Subject: [PATCH] Deprecate meaningless or vague-defined operations with Char operands. Change expected test output. --- compiler/testData/builtin-classes.txt | 160 +++++++++--------- .../assignmentOperationsCheckReturnType.kt | 8 +- .../thisAndSuper/thisInFunctionLiterals.kt | 12 +- .../thisAndSuper/thisInFunctionLiterals.txt | 2 +- .../pseudocodeMemoryOverhead.kt | 146 ++++++++-------- core/builtins/native/kotlin/Char.kt | 38 +++++ core/builtins/native/kotlin/Primitives.kt | 42 +++++ .../kotlin/generators/builtins/primitives.kt | 6 + .../checker/QualifiedThisInClosures.kt | 12 +- 9 files changed, 256 insertions(+), 170 deletions(-) diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 294e121a80e..74db9f36c66 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -49,7 +49,7 @@ public abstract class BooleanIterator : kotlin.Iterator { public final class Byte : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Byte() public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int @@ -57,7 +57,7 @@ public final class Byte : kotlin.Number, kotlin.Comparable { public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int public final fun dec(): kotlin.Byte public final fun div(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun div(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Char): kotlin.Int public final fun div(/*0*/ other: kotlin.Double): kotlin.Double public final fun div(/*0*/ other: kotlin.Float): kotlin.Float public final fun div(/*0*/ other: kotlin.Int): kotlin.Int @@ -66,14 +66,14 @@ public final class Byte : kotlin.Number, kotlin.Comparable { public final fun inc(): kotlin.Byte public final fun minus(): kotlin.Int public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Char): kotlin.Int public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float public final fun minus(/*0*/ other: kotlin.Int): kotlin.Int public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long public final fun minus(/*0*/ other: kotlin.Short): kotlin.Int public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Char): kotlin.Int public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float public final fun mod(/*0*/ other: kotlin.Int): kotlin.Int @@ -81,21 +81,21 @@ public final class Byte : kotlin.Number, kotlin.Comparable { public final fun mod(/*0*/ other: kotlin.Short): kotlin.Int public final fun plus(): kotlin.Int public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Char): kotlin.Int public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float public final fun plus(/*0*/ other: kotlin.Int): kotlin.Int public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long public final fun plus(/*0*/ other: kotlin.Short): kotlin.Int public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.ByteRange - public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.CharRange + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.CharRange public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.ShortRange public final fun times(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun times(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Char): kotlin.Int public final fun times(/*0*/ other: kotlin.Double): kotlin.Double public final fun times(/*0*/ other: kotlin.Float): kotlin.Float public final fun times(/*0*/ other: kotlin.Int): kotlin.Int @@ -184,49 +184,49 @@ public final class ByteRange : kotlin.Range, kotlin.Progression { /*primary*/ private constructor Char() - public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int public final fun dec(): kotlin.Char - public final fun div(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun div(/*0*/ other: kotlin.Double): kotlin.Double - public final fun div(/*0*/ other: kotlin.Float): kotlin.Float - public final fun div(/*0*/ other: kotlin.Int): kotlin.Int - public final fun div(/*0*/ other: kotlin.Long): kotlin.Long - public final fun div(/*0*/ other: kotlin.Short): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Byte): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Double): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Float): kotlin.Float + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Int): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Long): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Short): kotlin.Int public final fun inc(): kotlin.Char - public final fun minus(): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Int public final fun minus(/*0*/ other: kotlin.Char): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Int): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Short): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Int): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Long): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Short): kotlin.Int - public final fun plus(): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Int): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Short): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float + kotlin.deprecated(value = "This operation will change return type to Char in M13. Either call toInt or toChar on return value or convert Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Int): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Short): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Int): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Long): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Short): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float + kotlin.deprecated(value = "This operation will change return type to Char in M13. Either call toInt or toChar on return value or convert Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Int): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Short): kotlin.Int public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.CharRange - public final fun times(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun times(/*0*/ other: kotlin.Double): kotlin.Double - public final fun times(/*0*/ other: kotlin.Float): kotlin.Float - public final fun times(/*0*/ other: kotlin.Int): kotlin.Int - public final fun times(/*0*/ other: kotlin.Long): kotlin.Long - public final fun times(/*0*/ other: kotlin.Short): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Byte): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Double): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Float): kotlin.Float + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Int): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Long): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Short): kotlin.Int public open fun toByte(): kotlin.Byte public open fun toChar(): kotlin.Char public open fun toDouble(): kotlin.Double @@ -329,7 +329,7 @@ public interface Comparable { public final class Double : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Double() public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int @@ -337,7 +337,7 @@ public final class Double : kotlin.Number, kotlin.Comparable { public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int public final fun dec(): kotlin.Double public final fun div(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun div(/*0*/ other: kotlin.Char): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Char): kotlin.Double public final fun div(/*0*/ other: kotlin.Double): kotlin.Double public final fun div(/*0*/ other: kotlin.Float): kotlin.Double public final fun div(/*0*/ other: kotlin.Int): kotlin.Double @@ -346,14 +346,14 @@ public final class Double : kotlin.Number, kotlin.Comparable { public final fun inc(): kotlin.Double public final fun minus(): kotlin.Double public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Char): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Char): kotlin.Double public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double public final fun minus(/*0*/ other: kotlin.Float): kotlin.Double public final fun minus(/*0*/ other: kotlin.Int): kotlin.Double public final fun minus(/*0*/ other: kotlin.Long): kotlin.Double public final fun minus(/*0*/ other: kotlin.Short): kotlin.Double public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Char): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Char): kotlin.Double public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double public final fun mod(/*0*/ other: kotlin.Float): kotlin.Double public final fun mod(/*0*/ other: kotlin.Int): kotlin.Double @@ -361,21 +361,21 @@ public final class Double : kotlin.Number, kotlin.Comparable { public final fun mod(/*0*/ other: kotlin.Short): kotlin.Double public final fun plus(): kotlin.Double public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Char): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Char): kotlin.Double public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double public final fun plus(/*0*/ other: kotlin.Float): kotlin.Double public final fun plus(/*0*/ other: kotlin.Int): kotlin.Double public final fun plus(/*0*/ other: kotlin.Long): kotlin.Double public final fun plus(/*0*/ other: kotlin.Short): kotlin.Double public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.DoubleRange + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.DoubleRange public final fun times(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun times(/*0*/ other: kotlin.Char): kotlin.Double + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Char): kotlin.Double public final fun times(/*0*/ other: kotlin.Double): kotlin.Double public final fun times(/*0*/ other: kotlin.Float): kotlin.Double public final fun times(/*0*/ other: kotlin.Int): kotlin.Double @@ -479,7 +479,7 @@ public abstract class Enum> : kotlin.Comparable { public final class Float : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Float() public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int @@ -487,7 +487,7 @@ public final class Float : kotlin.Number, kotlin.Comparable { public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int public final fun dec(): kotlin.Float public final fun div(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun div(/*0*/ other: kotlin.Char): kotlin.Float + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Char): kotlin.Float public final fun div(/*0*/ other: kotlin.Double): kotlin.Double public final fun div(/*0*/ other: kotlin.Float): kotlin.Float public final fun div(/*0*/ other: kotlin.Int): kotlin.Float @@ -496,14 +496,14 @@ public final class Float : kotlin.Number, kotlin.Comparable { public final fun inc(): kotlin.Float public final fun minus(): kotlin.Float public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Char): kotlin.Float + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Char): kotlin.Float public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float public final fun minus(/*0*/ other: kotlin.Int): kotlin.Float public final fun minus(/*0*/ other: kotlin.Long): kotlin.Float public final fun minus(/*0*/ other: kotlin.Short): kotlin.Float public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Char): kotlin.Float + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Char): kotlin.Float public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float public final fun mod(/*0*/ other: kotlin.Int): kotlin.Float @@ -511,21 +511,21 @@ public final class Float : kotlin.Number, kotlin.Comparable { public final fun mod(/*0*/ other: kotlin.Short): kotlin.Float public final fun plus(): kotlin.Float public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Char): kotlin.Float + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Char): kotlin.Float public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float public final fun plus(/*0*/ other: kotlin.Int): kotlin.Float public final fun plus(/*0*/ other: kotlin.Long): kotlin.Float public final fun plus(/*0*/ other: kotlin.Short): kotlin.Float public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.FloatRange + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.FloatRange public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.FloatRange public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.FloatRange public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.FloatRange public final fun times(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun times(/*0*/ other: kotlin.Char): kotlin.Float + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Char): kotlin.Float public final fun times(/*0*/ other: kotlin.Double): kotlin.Double public final fun times(/*0*/ other: kotlin.Float): kotlin.Float public final fun times(/*0*/ other: kotlin.Int): kotlin.Float @@ -685,7 +685,7 @@ public final class Int : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Int() public final fun and(/*0*/ other: kotlin.Int): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int @@ -693,7 +693,7 @@ public final class Int : kotlin.Number, kotlin.Comparable { public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int public final fun dec(): kotlin.Int public final fun div(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun div(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Char): kotlin.Int public final fun div(/*0*/ other: kotlin.Double): kotlin.Double public final fun div(/*0*/ other: kotlin.Float): kotlin.Float public final fun div(/*0*/ other: kotlin.Int): kotlin.Int @@ -703,14 +703,14 @@ public final class Int : kotlin.Number, kotlin.Comparable { public final fun inv(): kotlin.Int public final fun minus(): kotlin.Int public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Char): kotlin.Int public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float public final fun minus(/*0*/ other: kotlin.Int): kotlin.Int public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long public final fun minus(/*0*/ other: kotlin.Short): kotlin.Int public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Char): kotlin.Int public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float public final fun mod(/*0*/ other: kotlin.Int): kotlin.Int @@ -719,14 +719,14 @@ public final class Int : kotlin.Number, kotlin.Comparable { public final fun or(/*0*/ other: kotlin.Int): kotlin.Int public final fun plus(): kotlin.Int public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Char): kotlin.Int public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float public final fun plus(/*0*/ other: kotlin.Int): kotlin.Int public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long public final fun plus(/*0*/ other: kotlin.Short): kotlin.Int public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.IntRange - public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.IntRange + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.IntRange public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange @@ -735,7 +735,7 @@ public final class Int : kotlin.Number, kotlin.Comparable { public final fun shl(/*0*/ bits: kotlin.Int): kotlin.Int public final fun shr(/*0*/ bits: kotlin.Int): kotlin.Int public final fun times(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun times(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Char): kotlin.Int public final fun times(/*0*/ other: kotlin.Double): kotlin.Double public final fun times(/*0*/ other: kotlin.Float): kotlin.Float public final fun times(/*0*/ other: kotlin.Int): kotlin.Int @@ -867,7 +867,7 @@ public final class Long : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Long() public final fun and(/*0*/ other: kotlin.Long): kotlin.Long public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int @@ -875,7 +875,7 @@ public final class Long : kotlin.Number, kotlin.Comparable { public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int public final fun dec(): kotlin.Long public final fun div(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun div(/*0*/ other: kotlin.Char): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Char): kotlin.Long public final fun div(/*0*/ other: kotlin.Double): kotlin.Double public final fun div(/*0*/ other: kotlin.Float): kotlin.Float public final fun div(/*0*/ other: kotlin.Int): kotlin.Long @@ -885,14 +885,14 @@ public final class Long : kotlin.Number, kotlin.Comparable { public final fun inv(): kotlin.Long public final fun minus(): kotlin.Long public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Char): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Char): kotlin.Long public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float public final fun minus(/*0*/ other: kotlin.Int): kotlin.Long public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long public final fun minus(/*0*/ other: kotlin.Short): kotlin.Long public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Char): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Char): kotlin.Long public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float public final fun mod(/*0*/ other: kotlin.Int): kotlin.Long @@ -901,14 +901,14 @@ public final class Long : kotlin.Number, kotlin.Comparable { public final fun or(/*0*/ other: kotlin.Long): kotlin.Long public final fun plus(): kotlin.Long public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Char): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Char): kotlin.Long public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float public final fun plus(/*0*/ other: kotlin.Int): kotlin.Long public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long public final fun plus(/*0*/ other: kotlin.Short): kotlin.Long public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.LongRange - public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.LongRange + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.LongRange public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.LongRange @@ -917,7 +917,7 @@ public final class Long : kotlin.Number, kotlin.Comparable { public final fun shl(/*0*/ bits: kotlin.Int): kotlin.Long public final fun shr(/*0*/ bits: kotlin.Int): kotlin.Long public final fun times(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun times(/*0*/ other: kotlin.Char): kotlin.Long + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Char): kotlin.Long public final fun times(/*0*/ other: kotlin.Double): kotlin.Double public final fun times(/*0*/ other: kotlin.Float): kotlin.Float public final fun times(/*0*/ other: kotlin.Int): kotlin.Long @@ -1173,7 +1173,7 @@ public interface Set : kotlin.Collection { public final class Short : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Short() public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int @@ -1181,7 +1181,7 @@ public final class Short : kotlin.Number, kotlin.Comparable { public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int public final fun dec(): kotlin.Short public final fun div(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun div(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun div(/*0*/ other: kotlin.Char): kotlin.Int public final fun div(/*0*/ other: kotlin.Double): kotlin.Double public final fun div(/*0*/ other: kotlin.Float): kotlin.Float public final fun div(/*0*/ other: kotlin.Int): kotlin.Int @@ -1190,14 +1190,14 @@ public final class Short : kotlin.Number, kotlin.Comparable { public final fun inc(): kotlin.Short public final fun minus(): kotlin.Int public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun minus(/*0*/ other: kotlin.Char): kotlin.Int public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float public final fun minus(/*0*/ other: kotlin.Int): kotlin.Int public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long public final fun minus(/*0*/ other: kotlin.Short): kotlin.Int public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun mod(/*0*/ other: kotlin.Char): kotlin.Int public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float public final fun mod(/*0*/ other: kotlin.Int): kotlin.Int @@ -1205,21 +1205,21 @@ public final class Short : kotlin.Number, kotlin.Comparable { public final fun mod(/*0*/ other: kotlin.Short): kotlin.Int public final fun plus(): kotlin.Int public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun plus(/*0*/ other: kotlin.Char): kotlin.Int public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float public final fun plus(/*0*/ other: kotlin.Int): kotlin.Int public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long public final fun plus(/*0*/ other: kotlin.Short): kotlin.Int public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.ShortRange - public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.ShortRange + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.ShortRange public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.ShortRange public final fun times(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun times(/*0*/ other: kotlin.Char): kotlin.Int + kotlin.deprecated(value = "This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.": kotlin.String) public final fun times(/*0*/ other: kotlin.Char): kotlin.Int public final fun times(/*0*/ other: kotlin.Double): kotlin.Double public final fun times(/*0*/ other: kotlin.Float): kotlin.Float public final fun times(/*0*/ other: kotlin.Int): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.kt index bf9d9cd5fe4..1f29d7de724 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.kt @@ -1,12 +1,12 @@ fun intBinEq() { var x = 0 - x += 'a' + x += 'a' x += 1.toByte() x += 1.toShort() x += 1L x += 1f x += 1.0 - x *= 'a' + x *= 'a' x *= 1.toByte() x *= 1.toShort() x *= 1L @@ -16,14 +16,14 @@ fun intBinEq() { fun shortBinEq() { var x = 0.toShort() - x += 'a' + x += 'a' x += 1.toByte() x += 1.toShort() x += 1L x += 1f x += 1.0 - x *= 'a' + x *= 'a' x *= 1.toByte() x *= 1.toShort() x *= 1L diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.kt b/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.kt index 73ae5bd5ee5..93e72d66b55 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.kt @@ -2,17 +2,17 @@ class A(val a:Int) { inner class B() { - fun Char.xx() : Double.() -> Any { - checkSubtype(this) + fun Byte.xx() : Double.() -> Any { + checkSubtype(this) val a: Double.() -> Unit = { checkSubtype(this) - checkSubtype(this@xx) + checkSubtype(this@xx) checkSubtype(this@B) checkSubtype(this@A) } - val b: Double.() -> Unit = a@{ checkSubtype(this@a) + checkSubtype(this@xx) } - val c = a@{ -> this@a + checkSubtype(this@xx) } - return (a@{checkSubtype(this@a) + checkSubtype(this@xx)}) + val b: Double.() -> Unit = a@{ checkSubtype(this@a) + checkSubtype(this@xx) } + val c = a@{ -> this@a + checkSubtype(this@xx) } + return (a@{checkSubtype(this@a) + checkSubtype(this@xx)}) } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.txt b/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.txt index f138e8e0427..3828a655a5f 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.txt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.txt @@ -12,6 +12,6 @@ internal final class A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - internal final fun kotlin.Char.xx(): kotlin.Double.() -> kotlin.Any + internal final fun kotlin.Byte.xx(): kotlin.Double.() -> kotlin.Any } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.kt b/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.kt index 781b1254cb1..c4078737066 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.kt @@ -49,10 +49,10 @@ private val unaryOperations: HashMap, Pair a.toShort() }, emptyUnaryFun), unaryOperation(BYTE, "toByte", { a -> a.toByte() }, emptyUnaryFun), unaryOperation(CHAR, "toInt", { a -> a.toInt() }, emptyUnaryFun), - unaryOperation(CHAR, "minus", { a -> a.minus() }, emptyUnaryFun), + unaryOperation(CHAR, "minus", { a -> a.minus() }, emptyUnaryFun), unaryOperation(CHAR, "toChar", { a -> a.toChar() }, emptyUnaryFun), unaryOperation(CHAR, "toLong", { a -> a.toLong() }, emptyUnaryFun), - unaryOperation(CHAR, "plus", { a -> a.plus() }, emptyUnaryFun), + unaryOperation(CHAR, "plus", { a -> a.plus() }, emptyUnaryFun), unaryOperation(CHAR, "toFloat", { a -> a.toFloat() }, emptyUnaryFun), unaryOperation(CHAR, "toDouble", { a -> a.toDouble() }, emptyUnaryFun), unaryOperation(CHAR, "toShort", { a -> a.toShort() }, emptyUnaryFun), @@ -115,110 +115,110 @@ private val binaryOperations: HashMap, Pair a.and(b) }, emptyBinaryFun), binaryOperation(BOOLEAN, BOOLEAN, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(BYTE, BYTE, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), - binaryOperation(BYTE, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(BYTE, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(BYTE, DOUBLE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(BYTE, FLOAT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(BYTE, INT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(BYTE, LONG, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(BYTE, SHORT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(BYTE, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(BYTE, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(BYTE, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(BYTE, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(BYTE, FLOAT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(BYTE, INT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(BYTE, LONG, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(BYTE, SHORT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(BYTE, BYTE, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), - binaryOperation(BYTE, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(BYTE, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(BYTE, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(BYTE, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(BYTE, INT, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(BYTE, LONG, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(BYTE, SHORT, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(BYTE, BYTE, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), - binaryOperation(BYTE, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(BYTE, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(BYTE, DOUBLE, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(BYTE, FLOAT, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(BYTE, INT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), binaryOperation(BYTE, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), binaryOperation(BYTE, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), binaryOperation(BYTE, BYTE, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), - binaryOperation(BYTE, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(BYTE, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(BYTE, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(BYTE, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(BYTE, INT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(BYTE, LONG, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(BYTE, SHORT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(BYTE, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), - binaryOperation(BYTE, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(BYTE, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(BYTE, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(BYTE, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(BYTE, INT, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), binaryOperation(BYTE, LONG, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), binaryOperation(BYTE, SHORT, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), binaryOperation(BYTE, ANY, "equals", { a, b -> a.equals(b) }, emptyBinaryFun), - binaryOperation(CHAR, BYTE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(CHAR, BYTE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(CHAR, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), - binaryOperation(CHAR, DOUBLE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), - binaryOperation(CHAR, FLOAT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), - binaryOperation(CHAR, INT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), - binaryOperation(CHAR, LONG, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), - binaryOperation(CHAR, SHORT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), - binaryOperation(CHAR, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(CHAR, DOUBLE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(CHAR, FLOAT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(CHAR, INT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(CHAR, LONG, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(CHAR, SHORT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(CHAR, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(CHAR, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(CHAR, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(CHAR, FLOAT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(CHAR, INT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(CHAR, LONG, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(CHAR, SHORT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(CHAR, BYTE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), - binaryOperation(CHAR, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), - binaryOperation(CHAR, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), - binaryOperation(CHAR, INT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), - binaryOperation(CHAR, LONG, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), - binaryOperation(CHAR, SHORT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), - binaryOperation(CHAR, BYTE, "div", { a, b -> a.div(b) }, emptyBinaryFun), - binaryOperation(CHAR, DOUBLE, "div", { a, b -> a.div(b) }, emptyBinaryFun), - binaryOperation(CHAR, FLOAT, "div", { a, b -> a.div(b) }, emptyBinaryFun), - binaryOperation(CHAR, INT, "div", { a, b -> a.div(b) }, emptyBinaryFun), - binaryOperation(CHAR, LONG, "div", { a, b -> a.div(b) }, emptyBinaryFun), - binaryOperation(CHAR, SHORT, "div", { a, b -> a.div(b) }, emptyBinaryFun), - binaryOperation(CHAR, BYTE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), - binaryOperation(CHAR, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), - binaryOperation(CHAR, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), - binaryOperation(CHAR, INT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), - binaryOperation(CHAR, LONG, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), - binaryOperation(CHAR, SHORT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), - binaryOperation(CHAR, BYTE, "times", { a, b -> a.times(b) }, emptyBinaryFun), - binaryOperation(CHAR, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun), - binaryOperation(CHAR, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun), - binaryOperation(CHAR, INT, "times", { a, b -> a.times(b) }, emptyBinaryFun), - binaryOperation(CHAR, LONG, "times", { a, b -> a.times(b) }, emptyBinaryFun), - binaryOperation(CHAR, SHORT, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(CHAR, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(CHAR, FLOAT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(CHAR, INT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(CHAR, LONG, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(CHAR, SHORT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(CHAR, BYTE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(CHAR, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(CHAR, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(CHAR, INT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(CHAR, LONG, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(CHAR, SHORT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(CHAR, BYTE, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(CHAR, DOUBLE, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(CHAR, FLOAT, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(CHAR, INT, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(CHAR, LONG, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(CHAR, SHORT, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(CHAR, BYTE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(CHAR, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(CHAR, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(CHAR, INT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(CHAR, LONG, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(CHAR, SHORT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(CHAR, BYTE, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(CHAR, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(CHAR, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(CHAR, INT, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(CHAR, LONG, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(CHAR, SHORT, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(CHAR, ANY, "equals", { a, b -> a.equals(b) }, emptyBinaryFun), binaryOperation(DOUBLE, BYTE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), - binaryOperation(DOUBLE, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(DOUBLE, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, DOUBLE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, FLOAT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, INT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, LONG, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, SHORT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(DOUBLE, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(DOUBLE, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(DOUBLE, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(DOUBLE, FLOAT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(DOUBLE, INT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(DOUBLE, LONG, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(DOUBLE, SHORT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(DOUBLE, BYTE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), - binaryOperation(DOUBLE, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(DOUBLE, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, INT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, LONG, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, SHORT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(DOUBLE, BYTE, "div", { a, b -> a.div(b) }, emptyBinaryFun), - binaryOperation(DOUBLE, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(DOUBLE, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(DOUBLE, DOUBLE, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(DOUBLE, FLOAT, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(DOUBLE, INT, "div", { a, b -> a.div(b) }, emptyBinaryFun), @@ -231,7 +231,7 @@ private val binaryOperations: HashMap, Pair a.mod(b) }, emptyBinaryFun), binaryOperation(DOUBLE, SHORT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(DOUBLE, BYTE, "times", { a, b -> a.times(b) }, emptyBinaryFun), - binaryOperation(DOUBLE, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(DOUBLE, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(DOUBLE, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(DOUBLE, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(DOUBLE, INT, "times", { a, b -> a.times(b) }, emptyBinaryFun), @@ -239,42 +239,42 @@ private val binaryOperations: HashMap, Pair a.times(b) }, emptyBinaryFun), binaryOperation(DOUBLE, ANY, "equals", { a, b -> a.equals(b) }, emptyBinaryFun), binaryOperation(FLOAT, BYTE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), - binaryOperation(FLOAT, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(FLOAT, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(FLOAT, DOUBLE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(FLOAT, FLOAT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(FLOAT, INT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(FLOAT, LONG, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(FLOAT, SHORT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(FLOAT, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(FLOAT, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(FLOAT, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(FLOAT, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(FLOAT, FLOAT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(FLOAT, INT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(FLOAT, LONG, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(FLOAT, SHORT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(FLOAT, BYTE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), - binaryOperation(FLOAT, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(FLOAT, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(FLOAT, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(FLOAT, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(FLOAT, INT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(FLOAT, LONG, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(FLOAT, SHORT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(FLOAT, BYTE, "div", { a, b -> a.div(b) }, emptyBinaryFun), - binaryOperation(FLOAT, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(FLOAT, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(FLOAT, DOUBLE, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(FLOAT, FLOAT, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(FLOAT, INT, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(FLOAT, LONG, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(FLOAT, SHORT, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(FLOAT, BYTE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), - binaryOperation(FLOAT, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(FLOAT, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(FLOAT, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(FLOAT, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(FLOAT, INT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(FLOAT, LONG, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(FLOAT, SHORT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(FLOAT, BYTE, "times", { a, b -> a.times(b) }, emptyBinaryFun), - binaryOperation(FLOAT, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(FLOAT, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(FLOAT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(FLOAT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(FLOAT, INT, "times", { a, b -> a.times(b) }, emptyBinaryFun), @@ -282,14 +282,14 @@ private val binaryOperations: HashMap, Pair a.times(b) }, emptyBinaryFun), binaryOperation(FLOAT, ANY, "equals", { a, b -> a.equals(b) }, emptyBinaryFun), binaryOperation(INT, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(INT, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(INT, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(INT, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(INT, FLOAT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(INT, INT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(INT, LONG, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(INT, SHORT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(INT, BYTE, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), - binaryOperation(INT, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(INT, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(INT, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(INT, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(INT, INT, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), @@ -298,7 +298,7 @@ private val binaryOperations: HashMap, Pair a.shl(b) }, emptyBinaryFun), binaryOperation(INT, INT, "ushr", { a, b -> a.ushr(b) }, emptyBinaryFun), binaryOperation(INT, BYTE, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), - binaryOperation(INT, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(INT, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(INT, DOUBLE, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(INT, FLOAT, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(INT, INT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), @@ -306,14 +306,14 @@ private val binaryOperations: HashMap, Pair a.div(b) }, { a, b -> a.divide(b) }), binaryOperation(INT, INT, "shr", { a, b -> a.shr(b) }, emptyBinaryFun), binaryOperation(INT, BYTE, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), - binaryOperation(INT, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(INT, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(INT, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(INT, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(INT, INT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(INT, LONG, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(INT, SHORT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(INT, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), - binaryOperation(INT, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(INT, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(INT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(INT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(INT, INT, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), @@ -321,7 +321,7 @@ private val binaryOperations: HashMap, Pair a.times(b) }, { a, b -> a.multiply(b) }), binaryOperation(INT, INT, "or", { a, b -> a.or(b) }, { a, b -> a.or(b) }), binaryOperation(INT, BYTE, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), - binaryOperation(INT, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(INT, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(INT, DOUBLE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(INT, FLOAT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(INT, INT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), @@ -331,14 +331,14 @@ private val binaryOperations: HashMap, Pair a.xor(b) }, { a, b -> a.xor(b) }), binaryOperation(INT, ANY, "equals", { a, b -> a.equals(b) }, emptyBinaryFun), binaryOperation(LONG, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(LONG, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(LONG, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(LONG, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(LONG, FLOAT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(LONG, INT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(LONG, LONG, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(LONG, SHORT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(LONG, BYTE, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), - binaryOperation(LONG, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(LONG, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(LONG, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(LONG, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(LONG, INT, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), @@ -347,7 +347,7 @@ private val binaryOperations: HashMap, Pair a.shl(b) }, emptyBinaryFun), binaryOperation(LONG, INT, "ushr", { a, b -> a.ushr(b) }, emptyBinaryFun), binaryOperation(LONG, BYTE, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), - binaryOperation(LONG, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(LONG, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(LONG, DOUBLE, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(LONG, FLOAT, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(LONG, INT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), @@ -355,14 +355,14 @@ private val binaryOperations: HashMap, Pair a.div(b) }, { a, b -> a.divide(b) }), binaryOperation(LONG, INT, "shr", { a, b -> a.shr(b) }, emptyBinaryFun), binaryOperation(LONG, BYTE, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), - binaryOperation(LONG, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(LONG, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(LONG, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(LONG, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(LONG, INT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(LONG, LONG, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(LONG, SHORT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(LONG, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), - binaryOperation(LONG, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(LONG, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(LONG, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(LONG, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(LONG, INT, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), @@ -370,7 +370,7 @@ private val binaryOperations: HashMap, Pair a.times(b) }, { a, b -> a.multiply(b) }), binaryOperation(LONG, LONG, "or", { a, b -> a.or(b) }, { a, b -> a.or(b) }), binaryOperation(LONG, BYTE, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), - binaryOperation(LONG, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(LONG, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(LONG, DOUBLE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(LONG, FLOAT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(LONG, INT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), @@ -380,42 +380,42 @@ private val binaryOperations: HashMap, Pair a.xor(b) }, { a, b -> a.xor(b) }), binaryOperation(LONG, ANY, "equals", { a, b -> a.equals(b) }, emptyBinaryFun), binaryOperation(SHORT, BYTE, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), - binaryOperation(SHORT, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), + binaryOperation(SHORT, CHAR, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(SHORT, DOUBLE, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(SHORT, FLOAT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun), binaryOperation(SHORT, INT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(SHORT, LONG, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(SHORT, SHORT, "minus", { a, b -> a.minus(b) }, { a, b -> a.subtract(b) }), binaryOperation(SHORT, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), - binaryOperation(SHORT, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), + binaryOperation(SHORT, CHAR, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(SHORT, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(SHORT, FLOAT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(SHORT, INT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(SHORT, LONG, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(SHORT, SHORT, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun), binaryOperation(SHORT, BYTE, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), - binaryOperation(SHORT, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), + binaryOperation(SHORT, CHAR, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(SHORT, DOUBLE, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(SHORT, FLOAT, "plus", { a, b -> a.plus(b) }, emptyBinaryFun), binaryOperation(SHORT, INT, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(SHORT, LONG, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(SHORT, SHORT, "plus", { a, b -> a.plus(b) }, { a, b -> a.add(b) }), binaryOperation(SHORT, BYTE, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), - binaryOperation(SHORT, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), + binaryOperation(SHORT, CHAR, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(SHORT, DOUBLE, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(SHORT, FLOAT, "div", { a, b -> a.div(b) }, emptyBinaryFun), binaryOperation(SHORT, INT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), binaryOperation(SHORT, LONG, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), binaryOperation(SHORT, SHORT, "div", { a, b -> a.div(b) }, { a, b -> a.divide(b) }), binaryOperation(SHORT, BYTE, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), - binaryOperation(SHORT, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), + binaryOperation(SHORT, CHAR, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(SHORT, DOUBLE, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(SHORT, FLOAT, "mod", { a, b -> a.mod(b) }, emptyBinaryFun), binaryOperation(SHORT, INT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(SHORT, LONG, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(SHORT, SHORT, "mod", { a, b -> a.mod(b) }, { a, b -> a.mod(b) }), binaryOperation(SHORT, BYTE, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), - binaryOperation(SHORT, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), + binaryOperation(SHORT, CHAR, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(SHORT, DOUBLE, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(SHORT, FLOAT, "times", { a, b -> a.times(b) }, emptyBinaryFun), binaryOperation(SHORT, INT, "times", { a, b -> a.times(b) }, { a, b -> a.multiply(b) }), diff --git a/core/builtins/native/kotlin/Char.kt b/core/builtins/native/kotlin/Char.kt index a88ef3ed831..e9d618dffed 100644 --- a/core/builtins/native/kotlin/Char.kt +++ b/core/builtins/native/kotlin/Char.kt @@ -28,6 +28,7 @@ public class Char private () : Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.") public fun compareTo(other: Byte): Int /** * Compares this value with the specified value for order. @@ -40,97 +41,132 @@ public class Char private () : Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.") public fun compareTo(other: Short): Int /** * Compares the character code of this character with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.") public fun compareTo(other: Int): Int /** * Compares the character code of this character with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int or other operand to Char.") public fun compareTo(other: Long): Int /** * Compares the character code of this character with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun compareTo(other: Float): Int /** * Compares the character code of this character with the specified value for order. * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun compareTo(other: Double): Int /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Byte): Int /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Short): Int /** Adds the other value to this value. */ + deprecated("This operation will change return type to Char in M13. Either call toInt or toChar on return value or convert Char operand to Int.") public fun plus(other: Int): Int /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Long): Long /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Float): Float /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Double): Double /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Byte): Int /** Subtracts the other value from this value. */ public fun minus(other: Char): Int /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Short): Int /** Subtracts the other value from this value. */ + deprecated("This operation will change return type to Char in M13. Either call toInt or toChar on return value or convert Char operand to Int.") public fun minus(other: Int): Int /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Long): Long /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Float): Float /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Double): Double /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Byte): Int /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Short): Int /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Int): Int /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Long): Long /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Float): Float /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Double): Double /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Byte): Int /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Short): Int /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Int): Int /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Long): Long /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Float): Float /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Double): Double /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Short): Int /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Int): Int /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Long): Long /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Float): Float /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Double): Double /** Increments this value. */ @@ -138,8 +174,10 @@ public class Char private () : Comparable { /** Decrements this value. */ public fun dec(): Char /** Returns this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(): Int /** Returns the negative of this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(): Int /** Creates a range from this value to the specified [other] value. */ diff --git a/core/builtins/native/kotlin/Primitives.kt b/core/builtins/native/kotlin/Primitives.kt index a07f4c7dd43..1f4bbc8b09d 100644 --- a/core/builtins/native/kotlin/Primitives.kt +++ b/core/builtins/native/kotlin/Primitives.kt @@ -36,6 +36,7 @@ public class Byte private () : Number, Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun compareTo(other: Char): Int /** * Compares this value with the specified value for order. @@ -71,6 +72,7 @@ public class Byte private () : Number, Comparable { /** Adds the other value to this value. */ public fun plus(other: Byte): Int /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Char): Int /** Adds the other value to this value. */ public fun plus(other: Short): Int @@ -86,6 +88,7 @@ public class Byte private () : Number, Comparable { /** Subtracts the other value from this value. */ public fun minus(other: Byte): Int /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Char): Int /** Subtracts the other value from this value. */ public fun minus(other: Short): Int @@ -101,6 +104,7 @@ public class Byte private () : Number, Comparable { /** Multiplies this value by the other value. */ public fun times(other: Byte): Int /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Char): Int /** Multiplies this value by the other value. */ public fun times(other: Short): Int @@ -116,6 +120,7 @@ public class Byte private () : Number, Comparable { /** Divides this value by the other value. */ public fun div(other: Byte): Int /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Char): Int /** Divides this value by the other value. */ public fun div(other: Short): Int @@ -131,6 +136,7 @@ public class Byte private () : Number, Comparable { /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Char): Int /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Short): Int @@ -155,6 +161,7 @@ public class Byte private () : Number, Comparable { /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Byte): ByteRange /** Creates a range from this value to the specified [other] value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun rangeTo(other: Char): CharRange /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Short): ShortRange @@ -194,6 +201,7 @@ public class Short private () : Number, Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun compareTo(other: Char): Int /** * Compares this value with the specified value for order. @@ -229,6 +237,7 @@ public class Short private () : Number, Comparable { /** Adds the other value to this value. */ public fun plus(other: Byte): Int /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Char): Int /** Adds the other value to this value. */ public fun plus(other: Short): Int @@ -244,6 +253,7 @@ public class Short private () : Number, Comparable { /** Subtracts the other value from this value. */ public fun minus(other: Byte): Int /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Char): Int /** Subtracts the other value from this value. */ public fun minus(other: Short): Int @@ -259,6 +269,7 @@ public class Short private () : Number, Comparable { /** Multiplies this value by the other value. */ public fun times(other: Byte): Int /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Char): Int /** Multiplies this value by the other value. */ public fun times(other: Short): Int @@ -274,6 +285,7 @@ public class Short private () : Number, Comparable { /** Divides this value by the other value. */ public fun div(other: Byte): Int /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Char): Int /** Divides this value by the other value. */ public fun div(other: Short): Int @@ -289,6 +301,7 @@ public class Short private () : Number, Comparable { /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Char): Int /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Short): Int @@ -313,6 +326,7 @@ public class Short private () : Number, Comparable { /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Byte): ShortRange /** Creates a range from this value to the specified [other] value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun rangeTo(other: Char): ShortRange /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Short): ShortRange @@ -352,6 +366,7 @@ public class Int private () : Number, Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun compareTo(other: Char): Int /** * Compares this value with the specified value for order. @@ -387,6 +402,7 @@ public class Int private () : Number, Comparable { /** Adds the other value to this value. */ public fun plus(other: Byte): Int /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Char): Int /** Adds the other value to this value. */ public fun plus(other: Short): Int @@ -402,6 +418,7 @@ public class Int private () : Number, Comparable { /** Subtracts the other value from this value. */ public fun minus(other: Byte): Int /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Char): Int /** Subtracts the other value from this value. */ public fun minus(other: Short): Int @@ -417,6 +434,7 @@ public class Int private () : Number, Comparable { /** Multiplies this value by the other value. */ public fun times(other: Byte): Int /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Char): Int /** Multiplies this value by the other value. */ public fun times(other: Short): Int @@ -432,6 +450,7 @@ public class Int private () : Number, Comparable { /** Divides this value by the other value. */ public fun div(other: Byte): Int /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Char): Int /** Divides this value by the other value. */ public fun div(other: Short): Int @@ -447,6 +466,7 @@ public class Int private () : Number, Comparable { /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Byte): Int /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Char): Int /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Short): Int @@ -471,6 +491,7 @@ public class Int private () : Number, Comparable { /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Byte): IntRange /** Creates a range from this value to the specified [other] value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun rangeTo(other: Char): IntRange /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Short): IntRange @@ -525,6 +546,7 @@ public class Long private () : Number, Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun compareTo(other: Char): Int /** * Compares this value with the specified value for order. @@ -560,6 +582,7 @@ public class Long private () : Number, Comparable { /** Adds the other value to this value. */ public fun plus(other: Byte): Long /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Char): Long /** Adds the other value to this value. */ public fun plus(other: Short): Long @@ -575,6 +598,7 @@ public class Long private () : Number, Comparable { /** Subtracts the other value from this value. */ public fun minus(other: Byte): Long /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Char): Long /** Subtracts the other value from this value. */ public fun minus(other: Short): Long @@ -590,6 +614,7 @@ public class Long private () : Number, Comparable { /** Multiplies this value by the other value. */ public fun times(other: Byte): Long /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Char): Long /** Multiplies this value by the other value. */ public fun times(other: Short): Long @@ -605,6 +630,7 @@ public class Long private () : Number, Comparable { /** Divides this value by the other value. */ public fun div(other: Byte): Long /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Char): Long /** Divides this value by the other value. */ public fun div(other: Short): Long @@ -620,6 +646,7 @@ public class Long private () : Number, Comparable { /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Byte): Long /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Char): Long /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Short): Long @@ -644,6 +671,7 @@ public class Long private () : Number, Comparable { /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Byte): LongRange /** Creates a range from this value to the specified [other] value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun rangeTo(other: Char): LongRange /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Short): LongRange @@ -698,6 +726,7 @@ public class Float private () : Number, Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun compareTo(other: Char): Int /** * Compares this value with the specified value for order. @@ -733,6 +762,7 @@ public class Float private () : Number, Comparable { /** Adds the other value to this value. */ public fun plus(other: Byte): Float /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Char): Float /** Adds the other value to this value. */ public fun plus(other: Short): Float @@ -748,6 +778,7 @@ public class Float private () : Number, Comparable { /** Subtracts the other value from this value. */ public fun minus(other: Byte): Float /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Char): Float /** Subtracts the other value from this value. */ public fun minus(other: Short): Float @@ -763,6 +794,7 @@ public class Float private () : Number, Comparable { /** Multiplies this value by the other value. */ public fun times(other: Byte): Float /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Char): Float /** Multiplies this value by the other value. */ public fun times(other: Short): Float @@ -778,6 +810,7 @@ public class Float private () : Number, Comparable { /** Divides this value by the other value. */ public fun div(other: Byte): Float /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Char): Float /** Divides this value by the other value. */ public fun div(other: Short): Float @@ -793,6 +826,7 @@ public class Float private () : Number, Comparable { /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Byte): Float /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Char): Float /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Short): Float @@ -817,6 +851,7 @@ public class Float private () : Number, Comparable { /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Byte): FloatRange /** Creates a range from this value to the specified [other] value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun rangeTo(other: Char): FloatRange /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Short): FloatRange @@ -856,6 +891,7 @@ public class Double private () : Number, Comparable { * Returns zero if this value is equal to the specified other value, a negative number if its less than other, * or a positive number if its greater than other. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun compareTo(other: Char): Int /** * Compares this value with the specified value for order. @@ -891,6 +927,7 @@ public class Double private () : Number, Comparable { /** Adds the other value to this value. */ public fun plus(other: Byte): Double /** Adds the other value to this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun plus(other: Char): Double /** Adds the other value to this value. */ public fun plus(other: Short): Double @@ -906,6 +943,7 @@ public class Double private () : Number, Comparable { /** Subtracts the other value from this value. */ public fun minus(other: Byte): Double /** Subtracts the other value from this value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun minus(other: Char): Double /** Subtracts the other value from this value. */ public fun minus(other: Short): Double @@ -921,6 +959,7 @@ public class Double private () : Number, Comparable { /** Multiplies this value by the other value. */ public fun times(other: Byte): Double /** Multiplies this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun times(other: Char): Double /** Multiplies this value by the other value. */ public fun times(other: Short): Double @@ -936,6 +975,7 @@ public class Double private () : Number, Comparable { /** Divides this value by the other value. */ public fun div(other: Byte): Double /** Divides this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun div(other: Char): Double /** Divides this value by the other value. */ public fun div(other: Short): Double @@ -951,6 +991,7 @@ public class Double private () : Number, Comparable { /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Byte): Double /** Calculates the remainder of dividing this value by the other value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun mod(other: Char): Double /** Calculates the remainder of dividing this value by the other value. */ public fun mod(other: Short): Double @@ -975,6 +1016,7 @@ public class Double private () : Number, Comparable { /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Byte): DoubleRange /** Creates a range from this value to the specified [other] value. */ + deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.") public fun rangeTo(other: Char): DoubleRange /** Creates a range from this value to the specified [other] value. */ public fun rangeTo(other: Short): DoubleRange diff --git a/generators/src/org/jetbrains/kotlin/generators/builtins/primitives.kt b/generators/src/org/jetbrains/kotlin/generators/builtins/primitives.kt index b06964c0dad..a54d632126c 100644 --- a/generators/src/org/jetbrains/kotlin/generators/builtins/primitives.kt +++ b/generators/src/org/jetbrains/kotlin/generators/builtins/primitives.kt @@ -100,6 +100,8 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) { out.println(" * Returns zero if this value is equal to the specified other value, a negative number if its less than other, ") out.println(" * or a positive number if its greater than other.") out.println(" */") + if (otherKind == PrimitiveType.CHAR) + out.println(""" deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.")""") out.print(" public ") if (otherKind == thisKind) out.print("override ") out.println("fun compareTo(other: ${otherKind.capitalized}): Int") @@ -117,6 +119,8 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) { for (otherKind in PrimitiveType.exceptBoolean) { val returnType = getOperatorReturnType(thisKind, otherKind) out.println(" /** $doc */") + if (otherKind == PrimitiveType.CHAR) + out.println(""" deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.")""") out.println(" public fun $name(other: ${otherKind.capitalized}): $returnType") } out.println() @@ -126,6 +130,8 @@ class GeneratePrimitives(out: PrintWriter) : BuiltInsSourceGenerator(out) { for (otherKind in PrimitiveType.exceptBoolean) { val returnType = if (otherKind.ordinal() > thisKind.ordinal()) otherKind else thisKind out.println(" /** Creates a range from this value to the specified [other] value. */") + if (otherKind == PrimitiveType.CHAR) + out.println(""" deprecated("This operation doesn't make sense and shall be removed in M13. Consider converting Char operand to Int.")""") out.println(" public fun rangeTo(other: ${otherKind.capitalized}): ${returnType.capitalized}Range") } out.println() diff --git a/idea/testData/checker/QualifiedThisInClosures.kt b/idea/testData/checker/QualifiedThisInClosures.kt index 43af80f8b90..7a0eb89df7f 100644 --- a/idea/testData/checker/QualifiedThisInClosures.kt +++ b/idea/testData/checker/QualifiedThisInClosures.kt @@ -7,12 +7,12 @@ class A(val a:Int) { val y = checkSubtype(this@A) val z = checkSubtype(this) val Int.xx : Int get() = checkSubtype(this) - fun Char.xx() : Double.() -> Unit { - checkSubtype(this) - val a: Double.() -> Unit = { checkSubtype(this) + checkSubtype(this@xx) } - val b: Double.() -> Unit = a@{checkSubtype(this@a) + checkSubtype(this@xx) } - val c = a@{this@a + checkSubtype(this@xx) } - return (a@{checkSubtype(this@a) + checkSubtype(this@xx) }) + fun Byte.xx() : Double.() -> Unit { + checkSubtype(this) + val a: Double.() -> Unit = { checkSubtype(this) + checkSubtype(this@xx) } + val b: Double.() -> Unit = a@{checkSubtype(this@a) + checkSubtype(this@xx) } + val c = a@{this@a + checkSubtype(this@xx) } + return (a@{checkSubtype(this@a) + checkSubtype(this@xx) }) } } }