From f080dbb78c1d7b4b4e5639228f577e1d932a0c51 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 15 Jul 2021 14:11:40 +0200 Subject: [PATCH] Update `resolveAnnotations` tests in new infrastructure --- .../tests/annotations/parameters/byte.fir.kt | 12 +++++++++ .../tests/annotations/parameters/byte.kt | 2 +- .../tests/annotations/parameters/byte.txt | 22 ++++++++++++++++ .../tests/annotations/parameters/char.kt | 3 ++- .../tests/annotations/parameters/char.txt | 26 +++++++++++++++++++ .../annotations/parameters/double.fir.kt | 12 +++++++++ .../tests/annotations/parameters/double.kt | 2 +- .../tests/annotations/parameters/double.txt | 22 ++++++++++++++++ .../parameters/expressions/andAnd.kt | 1 + .../parameters/expressions/andAnd.txt | 20 ++++++++++++++ .../parameters/expressions/boolean.fir.kt | 11 ++++++++ .../parameters/expressions/boolean.txt | 21 +++++++++++++++ .../parameters/expressions/char.fir.kt | 7 +++++ .../parameters/expressions/char.kt | 2 +- .../parameters/expressions/char.txt | 19 ++++++++++++++ .../expressions/compositeCallBinary.kt | 1 + .../expressions/compositeCallBinary.txt | 21 +++++++++++++++ .../parameters/expressions/divide.fir.kt | 12 +++++++++ .../parameters/expressions/divide.kt | 2 +- .../parameters/expressions/divide.txt | 22 ++++++++++++++++ .../parameters/expressions/double.kt | 1 + .../parameters/expressions/double.txt | 21 +++++++++++++++ .../parameters/expressions/eqeq.kt | 1 + .../parameters/expressions/eqeq.txt | 23 ++++++++++++++++ .../parameters/expressions/escapedString.kt | 1 + .../parameters/expressions/escapedString.txt | 19 ++++++++++++++ .../parameters/expressions/float.kt | 1 + .../parameters/expressions/float.txt | 21 +++++++++++++++ .../parameters/expressions/gt.fir.kt | 17 ++++++++++++ .../annotations/parameters/expressions/gt.kt | 2 +- .../annotations/parameters/expressions/gt.txt | 26 +++++++++++++++++++ .../parameters/expressions/gteq.fir.kt | 12 +++++++++ .../parameters/expressions/gteq.txt | 22 ++++++++++++++++ .../parameters/expressions/intrincics.fir.kt | 13 ++++++++++ .../parameters/expressions/intrincics.kt | 14 +++++----- .../parameters/expressions/intrincics.txt | 18 +++++++++++++ .../parameters/expressions/labeled.kt | 3 ++- .../parameters/expressions/labeled.txt | 18 +++++++++++++ .../parameters/expressions/long.fir.kt | 11 ++++++++ .../parameters/expressions/long.kt | 2 +- .../parameters/expressions/long.txt | 21 +++++++++++++++ .../parameters/expressions/lt.fir.kt | 17 ++++++++++++ .../annotations/parameters/expressions/lt.kt | 2 +- .../annotations/parameters/expressions/lt.txt | 26 +++++++++++++++++++ .../parameters/expressions/lteq.fir.kt | 12 +++++++++ .../parameters/expressions/lteq.txt | 22 ++++++++++++++++ .../parameters/expressions/maxValue.fir.kt | 21 +++++++++++++++ .../parameters/expressions/maxValue.kt | 10 +++---- .../parameters/expressions/maxValue.txt | 24 +++++++++++++++++ .../expressions/maxValueByte.fir.kt | 19 ++++++++++++++ .../parameters/expressions/maxValueByte.kt | 6 ++--- .../parameters/expressions/maxValueByte.txt | 23 ++++++++++++++++ .../parameters/expressions/maxValueInt.fir.kt | 19 ++++++++++++++ .../parameters/expressions/maxValueInt.kt | 6 ++--- .../parameters/expressions/maxValueInt.txt | 23 ++++++++++++++++ .../parameters/expressions/miltiply.fir.kt | 12 +++++++++ .../parameters/expressions/miltiply.kt | 2 +- .../parameters/expressions/miltiply.txt | 22 ++++++++++++++++ .../parameters/expressions/minus.fir.kt | 12 +++++++++ .../parameters/expressions/minus.kt | 2 +- .../parameters/expressions/minus.txt | 22 ++++++++++++++++ .../parameters/expressions/mod.fir.kt | 12 +++++++++ .../annotations/parameters/expressions/mod.kt | 2 +- .../parameters/expressions/mod.txt | 22 ++++++++++++++++ .../parameters/expressions/multilineString.kt | 1 + .../expressions/multilineString.txt | 19 ++++++++++++++ .../annotations/parameters/expressions/not.kt | 3 ++- .../parameters/expressions/not.txt | 22 ++++++++++++++++ .../parameters/expressions/noteq.kt | 1 + .../parameters/expressions/noteq.txt | 23 ++++++++++++++++ .../parameters/expressions/orOr.kt | 1 + .../parameters/expressions/orOr.txt | 20 ++++++++++++++ .../parameters/expressions/paranthesized.kt | 3 ++- .../parameters/expressions/paranthesized.txt | 18 +++++++++++++ .../parameters/expressions/plus.fir.kt | 12 +++++++++ .../parameters/expressions/plus.kt | 2 +- .../parameters/expressions/plus.txt | 22 ++++++++++++++++ .../expressions/simpleCallBinary.kt | 1 + .../expressions/simpleCallBinary.txt | 23 ++++++++++++++++ .../parameters/expressions/stringPlusInt.kt | 1 + .../parameters/expressions/stringPlusInt.txt | 19 ++++++++++++++ .../expressions/stringTemplate.fir.kt | 19 ++++++++++++++ .../parameters/expressions/stringTemplate.kt | 8 +++--- .../parameters/expressions/stringTemplate.txt | 23 ++++++++++++++++ .../parameters/expressions/strings.fir.kt | 9 +++++++ .../parameters/expressions/strings.kt | 2 +- .../parameters/expressions/strings.txt | 21 +++++++++++++++ .../parameters/expressions/unaryMinus.kt | 1 + .../parameters/expressions/unaryMinus.txt | 24 +++++++++++++++++ .../parameters/expressions/unaryPlus.kt | 1 + .../parameters/expressions/unaryPlus.txt | 24 +++++++++++++++++ .../tests/annotations/parameters/float.kt | 1 + .../tests/annotations/parameters/float.txt | 20 ++++++++++++++ .../tests/annotations/parameters/int.fir.kt | 12 +++++++++ .../tests/annotations/parameters/int.kt | 2 +- .../tests/annotations/parameters/int.txt | 22 ++++++++++++++++ .../tests/annotations/parameters/long.kt | 1 + .../tests/annotations/parameters/long.txt | 20 ++++++++++++++ .../tests/annotations/parameters/short.fir.kt | 12 +++++++++ .../tests/annotations/parameters/short.kt | 2 +- .../tests/annotations/parameters/short.txt | 22 ++++++++++++++++ 101 files changed, 1242 insertions(+), 40 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/byte.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/byte.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/char.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/double.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/double.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/andAnd.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/boolean.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/boolean.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/compositeCallBinary.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/double.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/eqeq.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/escapedString.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/float.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/gteq.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/gteq.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/labeled.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/lteq.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/lteq.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/multilineString.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/not.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/noteq.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/orOr.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/paranthesized.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/simpleCallBinary.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringPlusInt.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryMinus.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryPlus.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/float.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/int.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/int.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/long.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/short.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/parameters/short.txt diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/byte.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/byte.fir.kt new file mode 100644 index 00000000000..a78c125d45a --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/byte.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b1: Byte, + val b2: Byte, + val b3: Byte, + val b4: Byte +) + +@Ann(1, 1.toByte(), 128.toByte(), 128) class MyClass + +// EXPECTED: @Ann(b1 = 1.toByte(), b2 = 1.toByte(), b3 = -128.toByte(), b4 = 128) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/byte.kt b/compiler/testData/diagnostics/tests/annotations/parameters/byte.kt index 5e450dbdfeb..36ea9003cd9 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/byte.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/byte.kt @@ -7,6 +7,6 @@ annotation class Ann( val b4: Byte ) -@Ann(1, 1.toByte(), 128.toByte(), 128) class MyClass +@Ann(1, 1.toByte(), 128.toByte(), 128) class MyClass // EXPECTED: @Ann(b1 = 1.toByte(), b2 = 1.toByte(), b3 = -128.toByte(), b4 = 128) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/byte.txt b/compiler/testData/diagnostics/tests/annotations/parameters/byte.txt new file mode 100644 index 00000000000..c3795a95980 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/byte.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Byte, /*1*/ b2: kotlin.Byte, /*2*/ b3: kotlin.Byte, /*3*/ b4: kotlin.Byte) + public final val b1: kotlin.Byte + public final val b2: kotlin.Byte + public final val b3: kotlin.Byte + public final val b4: kotlin.Byte + 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 + } + + @test.Ann(b1 = 1.toByte(), b2 = 1.toByte(), b3 = -128.toByte(), b4 = 128) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/char.kt b/compiler/testData/diagnostics/tests/annotations/parameters/char.kt index c5c896078b4..6ff73fdc348 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/char.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/char.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( @@ -11,6 +12,6 @@ annotation class Ann( val b8: Float ) -@Ann('c', 99.toChar(), 'c'.toInt(), 'c'.toLong(), 'c'.toByte(), 'c'.toShort(), 'c'.toDouble(), 'c'.toFloat()) class MyClass +@Ann('c', 99.toChar(), 'c'.toInt(), 'c'.toLong(), 'c'.toByte(), 'c'.toShort(), 'c'.toDouble(), 'c'.toFloat()) class MyClass // EXPECTED: @Ann(b1 = \u0063 ('c'), b2 = \u0063 ('c'), b3 = 99, b4 = 99.toLong(), b5 = 99.toByte(), b6 = 99.toShort(), b7 = 99.0.toDouble(), b8 = 99.0.toFloat()) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/char.txt b/compiler/testData/diagnostics/tests/annotations/parameters/char.txt new file mode 100644 index 00000000000..fda4ecb3358 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/char.txt @@ -0,0 +1,26 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Char, /*1*/ b2: kotlin.Char, /*2*/ b3: kotlin.Int, /*3*/ b4: kotlin.Long, /*4*/ b5: kotlin.Byte, /*5*/ b6: kotlin.Short, /*6*/ b7: kotlin.Double, /*7*/ b8: kotlin.Float) + public final val b1: kotlin.Char + public final val b2: kotlin.Char + public final val b3: kotlin.Int + public final val b4: kotlin.Long + public final val b5: kotlin.Byte + public final val b6: kotlin.Short + public final val b7: kotlin.Double + public final val b8: kotlin.Float + 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 + } + + @test.Ann(b1 = \u0063 ('c'), b2 = \u0063 ('c'), b3 = 99, b4 = 99.toLong(), b5 = 99.toByte(), b6 = 99.toShort(), b7 = 99.0.toDouble(), b8 = 99.0.toFloat()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/double.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/double.fir.kt new file mode 100644 index 00000000000..c5c2395f3fb --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/double.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b1: Double, + val b2: Double, + val b3: Double, + val b4: Double +) + +@Ann(1.0, 1.toDouble(), 1.7976931348623157E309.toDouble(), 1.7976931348623157E309) class MyClass + +// EXPECTED: @Ann(b1 = 1.0.toDouble(), b2 = 1.0.toDouble(), b3 = Infinity.toDouble(), b4 = Infinity.toDouble()) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/double.kt b/compiler/testData/diagnostics/tests/annotations/parameters/double.kt index c5c2395f3fb..4cc8db7dfd5 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/double.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/double.kt @@ -7,6 +7,6 @@ annotation class Ann( val b4: Double ) -@Ann(1.0, 1.toDouble(), 1.7976931348623157E309.toDouble(), 1.7976931348623157E309) class MyClass +@Ann(1.0, 1.toDouble(), 1.7976931348623157E309.toDouble(), 1.7976931348623157E309) class MyClass // EXPECTED: @Ann(b1 = 1.0.toDouble(), b2 = 1.0.toDouble(), b3 = Infinity.toDouble(), b4 = Infinity.toDouble()) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/double.txt b/compiler/testData/diagnostics/tests/annotations/parameters/double.txt new file mode 100644 index 00000000000..d6542a62b62 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/double.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Double, /*1*/ b2: kotlin.Double, /*2*/ b3: kotlin.Double, /*3*/ b4: kotlin.Double) + public final val b1: kotlin.Double + public final val b2: kotlin.Double + public final val b3: kotlin.Double + public final val b4: kotlin.Double + 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 + } + + @test.Ann(b1 = 1.0.toDouble(), b2 = 1.0.toDouble(), b3 = Infinity.toDouble(), b4 = Infinity.toDouble()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/andAnd.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/andAnd.kt index 5fd51ec01be..9f4fcff8ff0 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/andAnd.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/andAnd.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/andAnd.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/andAnd.txt new file mode 100644 index 00000000000..3d0b7e53303 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/andAnd.txt @@ -0,0 +1,20 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + 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 + } + + @test.Ann(b1 = false, b2 = true) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/boolean.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/boolean.fir.kt new file mode 100644 index 00000000000..ac0af61b932 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/boolean.fir.kt @@ -0,0 +1,11 @@ +package test + +annotation class Ann( + val b1: Boolean, + val b2: Boolean, + val b3: Boolean +) + +@Ann(true and false, false or true, true xor false) class MyClass + +// EXPECTED: @Ann(b1 = false, b2 = true, b3 = true) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/boolean.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/boolean.txt new file mode 100644 index 00000000000..6b47363101e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/boolean.txt @@ -0,0 +1,21 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean, /*2*/ b3: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + public final val b3: kotlin.Boolean + 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 + } + + @test.Ann(b1 = false, b2 = true, b3 = true) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.fir.kt new file mode 100644 index 00000000000..1e3a21745b1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.fir.kt @@ -0,0 +1,7 @@ +package test + +annotation class Ann(val c1: Char) + +@Ann('a' - 'a') class MyClass + +// EXPECTED: @Ann(c1 = 0) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.kt index f906582e91a..de17689f485 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.kt @@ -2,6 +2,6 @@ package test annotation class Ann(val c1: Char) -@Ann('a' - 'a') class MyClass +@Ann('a' - 'a') class MyClass // EXPECTED: @Ann(c1 = 0) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.txt new file mode 100644 index 00000000000..a325adc7a42 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/char.txt @@ -0,0 +1,19 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ c1: kotlin.Char) + public final val c1: kotlin.Char + 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 + } + + @test.Ann(c1 = 0) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/compositeCallBinary.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/compositeCallBinary.kt index d528c8a3c55..02874e716db 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/compositeCallBinary.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/compositeCallBinary.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/compositeCallBinary.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/compositeCallBinary.txt new file mode 100644 index 00000000000..6aae2d51f23 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/compositeCallBinary.txt @@ -0,0 +1,21 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ p1: kotlin.Int, /*1*/ p2: kotlin.Int, /*2*/ p3: kotlin.Int) + public final val p1: kotlin.Int + public final val p2: kotlin.Int + public final val p3: kotlin.Int + 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 + } + + @test.Ann(p1 = 2, p2 = 0, p3 = 1) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.fir.kt new file mode 100644 index 00000000000..9273659bb9f --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b: Byte, + val s: Short, + val i: Int, + val l: Long +) + +@Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass + +// EXPECTED: @Ann(b = 1.toByte(), i = 1, l = 1.toLong(), s = 1.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.kt index b40697857b0..c15b7a1a0bd 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.kt @@ -7,6 +7,6 @@ annotation class Ann( val l: Long ) -@Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass +@Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass // EXPECTED: @Ann(b = 1.toByte(), i = 1, l = 1.toLong(), s = 1.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.txt new file mode 100644 index 00000000000..bac4c4ac40e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/divide.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b: kotlin.Byte, /*1*/ s: kotlin.Short, /*2*/ i: kotlin.Int, /*3*/ l: kotlin.Long) + public final val b: kotlin.Byte + public final val i: kotlin.Int + public final val l: kotlin.Long + public final val s: kotlin.Short + 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 + } + + @test.Ann(b = 1.toByte(), i = 1, l = 1.toLong(), s = 1.toShort()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/double.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/double.kt index af96f533080..a933db6a8f2 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/double.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/double.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/double.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/double.txt new file mode 100644 index 00000000000..98d91f9e030 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/double.txt @@ -0,0 +1,21 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ d1: kotlin.Double, /*1*/ d2: kotlin.Double, /*2*/ d3: kotlin.Double) + public final val d1: kotlin.Double + public final val d2: kotlin.Double + public final val d3: kotlin.Double + 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 + } + + @test.Ann(d1 = 2.0.toDouble(), d2 = 2.0.toDouble(), d3 = 2.0.toDouble()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/eqeq.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/eqeq.kt index 63140411c8a..f33456ce2ba 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/eqeq.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/eqeq.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/eqeq.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/eqeq.txt new file mode 100644 index 00000000000..fd4143e323c --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/eqeq.txt @@ -0,0 +1,23 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean, /*2*/ b3: kotlin.Boolean, /*3*/ b4: kotlin.Boolean, /*4*/ b5: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + public final val b3: kotlin.Boolean + public final val b4: kotlin.Boolean + public final val b5: kotlin.Boolean + 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 + } + + @test.Ann(b1 = false, b2 = false, b3 = false, b4 = false, b5 = true) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/escapedString.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/escapedString.kt index bdab7a9bc2b..fdeda05a852 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/escapedString.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/escapedString.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann(val s1: String) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/escapedString.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/escapedString.txt new file mode 100644 index 00000000000..6aa440e6ca5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/escapedString.txt @@ -0,0 +1,19 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ s1: kotlin.String) + public final val s1: kotlin.String + 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 + } + + @test.Ann(s1 = "$ab") public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/float.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/float.kt index 1596b5cd1c8..e6d1f372f82 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/float.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/float.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/float.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/float.txt new file mode 100644 index 00000000000..191c87d675e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/float.txt @@ -0,0 +1,21 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ d1: kotlin.Float, /*1*/ d2: kotlin.Float, /*2*/ d3: kotlin.Double) + public final val d1: kotlin.Float + public final val d2: kotlin.Float + public final val d3: kotlin.Double + 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 + } + + @test.Ann(d1 = 2.0.toFloat(), d2 = 2.0.toFloat(), d3 = 2.0.toDouble()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.fir.kt new file mode 100644 index 00000000000..e833d722235 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.fir.kt @@ -0,0 +1,17 @@ +package test + +annotation class Ann( + val b1: Boolean, + val b2: Boolean, + val b3: Boolean, + val b4: Boolean, + val b5: Boolean, + val b6: Boolean +) + +val a = 1 +val b = 2 + +@Ann(1 > 2, 1.0 > 2.0, 2 > a, b > a, 'b' > 'a', "a" > "b") class MyClass + +// EXPECTED: @Ann(b1 = false, b2 = false, b3 = true, b4 = true, b5 = true, b6 = false) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.kt index f6098bbf46b..2dbab33016e 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.kt @@ -12,6 +12,6 @@ annotation class Ann( val a = 1 val b = 2 -@Ann(1 > 2, 1.0 > 2.0, 2 > a, b > a, 'b' > 'a', "a" > "b") class MyClass +@Ann(1 > 2, 1.0 > 2.0, 2 > a, b > a, 'b' > 'a', "a" > "b") class MyClass // EXPECTED: @Ann(b1 = false, b2 = false, b3 = true, b4 = true, b5 = true, b6 = false) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.txt new file mode 100644 index 00000000000..fc329abaa94 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gt.txt @@ -0,0 +1,26 @@ +package + +package test { + public val a: kotlin.Int = 1 + public val b: kotlin.Int = 2 + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean, /*2*/ b3: kotlin.Boolean, /*3*/ b4: kotlin.Boolean, /*4*/ b5: kotlin.Boolean, /*5*/ b6: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + public final val b3: kotlin.Boolean + public final val b4: kotlin.Boolean + public final val b5: kotlin.Boolean + public final val b6: kotlin.Boolean + 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 + } + + @test.Ann(b1 = false, b2 = false, b3 = true, b4 = true, b5 = true, b6 = false) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gteq.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gteq.fir.kt new file mode 100644 index 00000000000..ff04edc4b30 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gteq.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b1: Boolean, + val b2: Boolean, + val b3: Boolean, + val b4: Boolean +) + +@Ann(1 >= 2, 1.0 >= 2.0, 1 >= 1, 1.0 >= 1.0) class MyClass + +// EXPECTED: @Ann(b1 = false, b2 = false, b3 = true, b4 = true) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gteq.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gteq.txt new file mode 100644 index 00000000000..f380486b138 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/gteq.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean, /*2*/ b3: kotlin.Boolean, /*3*/ b4: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + public final val b3: kotlin.Boolean + public final val b4: kotlin.Boolean + 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 + } + + @test.Ann(b1 = false, b2 = false, b3 = true, b4 = true) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.fir.kt new file mode 100644 index 00000000000..a330568bccf --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.fir.kt @@ -0,0 +1,13 @@ +package test + +annotation class Ann(p1: Int, + p2: Short, + p3: Byte, + p4: Int, + p5: Int, + p6: Int + ) + +@Ann(1 or 1, 1 and 1, 1 xor 1, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass + +// EXPECTED: @Ann(p1 = 1, p2 = 1.toShort(), p3 = 0.toByte(), p4 = 2, p5 = 0, p6 = 0) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.kt index 8f74642be25..421f45ad246 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.kt @@ -1,13 +1,13 @@ package test -annotation class Ann(p1: Int, - p2: Short, - p3: Byte, - p4: Int, - p5: Int, - p6: Int +annotation class Ann(p1: Int, + p2: Short, + p3: Byte, + p4: Int, + p5: Int, + p6: Int ) -@Ann(1 or 1, 1 and 1, 1 xor 1, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass +@Ann(1 or 1, 1 and 1, 1 xor 1, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass // EXPECTED: @Ann(p1 = 1, p2 = 1.toShort(), p3 = 0.toByte(), p4 = 2, p5 = 0, p6 = 0) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.txt new file mode 100644 index 00000000000..6b6205f4b46 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/intrincics.txt @@ -0,0 +1,18 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ p1: kotlin.Int, /*1*/ p2: kotlin.Short, /*2*/ p3: kotlin.Byte, /*3*/ p4: kotlin.Int, /*4*/ p5: kotlin.Int, /*5*/ p6: kotlin.Int) + 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 + } + + @test.Ann(p1 = 1, p2 = 1.toShort(), p3 = 0.toByte(), p4 = 2, p5 = 0, p6 = 0) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/labeled.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/labeled.kt index 66a419c8f82..3a8340f5d41 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/labeled.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/labeled.kt @@ -1,6 +1,7 @@ +// FIR_IDENTICAL package test -annotation class Ann(i: Double) +annotation class Ann(i: Double) @Ann(A@ 1.0) class MyClass diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/labeled.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/labeled.txt new file mode 100644 index 00000000000..8bf8bfe6f0a --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/labeled.txt @@ -0,0 +1,18 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ i: kotlin.Double) + 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 + } + + @test.Ann(i = 1.0.toDouble()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.fir.kt new file mode 100644 index 00000000000..69c03d7d690 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.fir.kt @@ -0,0 +1,11 @@ +package test + +annotation class Ann( + val l1: Long, + val l2: Long, + val l3: Long +) + +@Ann(1 + 1, java.lang.Long.MAX_VALUE + 1 - 1, java.lang.Long.MAX_VALUE - 1) class MyClass + +// EXPECTED: @Ann(l1 = 2.toLong(), l2 = 9223372036854775807.toLong(), l3 = 9223372036854775806.toLong()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.kt index 52ed559f206..22a23c9f64e 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.kt @@ -6,6 +6,6 @@ annotation class Ann( val l3: Long ) -@Ann(1 + 1, java.lang.Long.MAX_VALUE + 1 - 1, java.lang.Long.MAX_VALUE - 1) class MyClass +@Ann(1 + 1, java.lang.Long.MAX_VALUE + 1 - 1, java.lang.Long.MAX_VALUE - 1) class MyClass // EXPECTED: @Ann(l1 = 2.toLong(), l2 = 9223372036854775807.toLong(), l3 = 9223372036854775806.toLong()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.txt new file mode 100644 index 00000000000..1e0f686cc6c --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/long.txt @@ -0,0 +1,21 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ l1: kotlin.Long, /*1*/ l2: kotlin.Long, /*2*/ l3: kotlin.Long) + public final val l1: kotlin.Long + public final val l2: kotlin.Long + public final val l3: kotlin.Long + 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 + } + + @test.Ann(l1 = 2.toLong(), l2 = 9223372036854775807.toLong(), l3 = 9223372036854775806.toLong()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.fir.kt new file mode 100644 index 00000000000..912ee99c65c --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.fir.kt @@ -0,0 +1,17 @@ +package test + +annotation class Ann( + val b1: Boolean, + val b2: Boolean, + val b3: Boolean, + val b4: Boolean, + val b5: Boolean, + val b6: Boolean +) + +val a = 1 +val b = 2 + +@Ann(1 < 2, 1.0 < 2.0, 2 < a, b < a, 'b' < 'a', "a" < "b") class MyClass + +// EXPECTED: @Ann(b1 = true, b2 = true, b3 = false, b4 = false, b5 = false, b6 = true) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.kt index 70d61cc4a88..51277eb9f4a 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.kt @@ -12,6 +12,6 @@ annotation class Ann( val a = 1 val b = 2 -@Ann(1 < 2, 1.0 < 2.0, 2 < a, b < a, 'b' < 'a', "a" < "b") class MyClass +@Ann(1 < 2, 1.0 < 2.0, 2 < a, b < a, 'b' < 'a', "a" < "b") class MyClass // EXPECTED: @Ann(b1 = true, b2 = true, b3 = false, b4 = false, b5 = false, b6 = true) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.txt new file mode 100644 index 00000000000..ee56f323763 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lt.txt @@ -0,0 +1,26 @@ +package + +package test { + public val a: kotlin.Int = 1 + public val b: kotlin.Int = 2 + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean, /*2*/ b3: kotlin.Boolean, /*3*/ b4: kotlin.Boolean, /*4*/ b5: kotlin.Boolean, /*5*/ b6: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + public final val b3: kotlin.Boolean + public final val b4: kotlin.Boolean + public final val b5: kotlin.Boolean + public final val b6: kotlin.Boolean + 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 + } + + @test.Ann(b1 = true, b2 = true, b3 = false, b4 = false, b5 = false, b6 = true) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lteq.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lteq.fir.kt new file mode 100644 index 00000000000..597215eb4fa --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lteq.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b1: Boolean, + val b2: Boolean, + val b3: Boolean, + val b4: Boolean +) + +@Ann(1 <= 2, 1.0 <= 2.0, 1 <= 1, 1.0 <= 1.0) class MyClass + +// EXPECTED: @Ann(b1 = true, b2 = true, b3 = true, b4 = true) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lteq.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lteq.txt new file mode 100644 index 00000000000..0523ac0868c --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/lteq.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean, /*2*/ b3: kotlin.Boolean, /*3*/ b4: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + public final val b3: kotlin.Boolean + public final val b4: kotlin.Boolean + 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 + } + + @test.Ann(b1 = true, b2 = true, b3 = true, b4 = true) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.fir.kt new file mode 100644 index 00000000000..1782fb282c5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.fir.kt @@ -0,0 +1,21 @@ +package test + +annotation class Ann( + val p1: Byte, + val p2: Short, + val p3: Int, + val p4: Int, + val p5: Long, + val p6: Long +) + +@Ann( + p1 = java.lang.Byte.MAX_VALUE + 1, + p2 = java.lang.Short.MAX_VALUE + 1, + p3 = java.lang.Integer.MAX_VALUE + 1, + p4 = java.lang.Integer.MAX_VALUE + 1, + p5 = java.lang.Integer.MAX_VALUE + 1.toLong(), + p6 = java.lang.Long.MAX_VALUE + 1 +) class MyClass + +// EXPECTED: @Ann(p1 = 128, p2 = 32768, p3 = -2147483648, p4 = -2147483648, p5 = 2147483648.toLong(), p6 = -9223372036854775808.toLong()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.kt index 0b9061d894a..7abdf2785cb 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.kt @@ -10,12 +10,12 @@ annotation class Ann( ) @Ann( - p1 = java.lang.Byte.MAX_VALUE + 1, - p2 = java.lang.Short.MAX_VALUE + 1, - p3 = java.lang.Integer.MAX_VALUE + 1, - p4 = java.lang.Integer.MAX_VALUE + 1, + p1 = java.lang.Byte.MAX_VALUE + 1, + p2 = java.lang.Short.MAX_VALUE + 1, + p3 = java.lang.Integer.MAX_VALUE + 1, + p4 = java.lang.Integer.MAX_VALUE + 1, p5 = java.lang.Integer.MAX_VALUE + 1.toLong(), - p6 = java.lang.Long.MAX_VALUE + 1 + p6 = java.lang.Long.MAX_VALUE + 1 ) class MyClass // EXPECTED: @Ann(p1 = 128, p2 = 32768, p3 = -2147483648, p4 = -2147483648, p5 = 2147483648.toLong(), p6 = -9223372036854775808.toLong()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.txt new file mode 100644 index 00000000000..a08c0de2fed --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValue.txt @@ -0,0 +1,24 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ p1: kotlin.Byte, /*1*/ p2: kotlin.Short, /*2*/ p3: kotlin.Int, /*3*/ p4: kotlin.Int, /*4*/ p5: kotlin.Long, /*5*/ p6: kotlin.Long) + public final val p1: kotlin.Byte + public final val p2: kotlin.Short + public final val p3: kotlin.Int + public final val p4: kotlin.Int + public final val p5: kotlin.Long + public final val p6: kotlin.Long + 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 + } + + @test.Ann(p1 = 128, p2 = 32768, p3 = -2147483648, p4 = -2147483648, p5 = 2147483648.toLong(), p6 = -9223372036854775808.toLong()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.fir.kt new file mode 100644 index 00000000000..5bffb467f24 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.fir.kt @@ -0,0 +1,19 @@ +package test + +annotation class Ann( + val p1: Byte, + val p2: Byte, + val p3: Int, + val p4: Int, + val p5: Byte +) + +@Ann( + p1 = java.lang.Byte.MAX_VALUE + 1, + p2 = 1 + 1, + p3 = java.lang.Byte.MAX_VALUE + 1, + p4 = 1.toByte() + 1.toByte(), + p5 = 1.toByte() + 1.toByte() +) class MyClass + +// EXPECTED: @Ann(p1 = 128, p2 = 2.toByte(), p3 = 128, p4 = 2, p5 = 2) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.kt index 17e4345f778..82c4055767d 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.kt @@ -9,11 +9,11 @@ annotation class Ann( ) @Ann( - p1 = java.lang.Byte.MAX_VALUE + 1, - p2 = 1 + 1, + p1 = java.lang.Byte.MAX_VALUE + 1, + p2 = 1 + 1, p3 = java.lang.Byte.MAX_VALUE + 1, p4 = 1.toByte() + 1.toByte(), - p5 = 1.toByte() + 1.toByte() + p5 = 1.toByte() + 1.toByte() ) class MyClass // EXPECTED: @Ann(p1 = 128, p2 = 2.toByte(), p3 = 128, p4 = 2, p5 = 2) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.txt new file mode 100644 index 00000000000..2baa5a7ce76 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueByte.txt @@ -0,0 +1,23 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ p1: kotlin.Byte, /*1*/ p2: kotlin.Byte, /*2*/ p3: kotlin.Int, /*3*/ p4: kotlin.Int, /*4*/ p5: kotlin.Byte) + public final val p1: kotlin.Byte + public final val p2: kotlin.Byte + public final val p3: kotlin.Int + public final val p4: kotlin.Int + public final val p5: kotlin.Byte + 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 + } + + @test.Ann(p1 = 128, p2 = 2.toByte(), p3 = 128, p4 = 2, p5 = 2) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.fir.kt new file mode 100644 index 00000000000..e75681b68f5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.fir.kt @@ -0,0 +1,19 @@ +package test + +annotation class Ann( + val p1: Int, + val p2: Int, + val p3: Long, + val p4: Long, + val p5: Int +) + +@Ann( + p1 = java.lang.Integer.MAX_VALUE + 1, + p2 = 1 + 1, + p3 = java.lang.Integer.MAX_VALUE + 1, + p4 = 1.toInt() + 1.toInt(), + p5 = 1.toInt() + 1.toInt() +) class MyClass + +// EXPECTED: @Ann(p1 = -2147483648, p2 = 2, p3 = -2147483648, p4 = 2, p5 = 2) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.kt index 0e184c38c4d..8260cf979a8 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.kt @@ -9,10 +9,10 @@ annotation class Ann( ) @Ann( - p1 = java.lang.Integer.MAX_VALUE + 1, + p1 = java.lang.Integer.MAX_VALUE + 1, p2 = 1 + 1, - p3 = java.lang.Integer.MAX_VALUE + 1, - p4 = 1.toInt() + 1.toInt(), + p3 = java.lang.Integer.MAX_VALUE + 1, + p4 = 1.toInt() + 1.toInt(), p5 = 1.toInt() + 1.toInt() ) class MyClass diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.txt new file mode 100644 index 00000000000..8c289a3a9e9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/maxValueInt.txt @@ -0,0 +1,23 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ p1: kotlin.Int, /*1*/ p2: kotlin.Int, /*2*/ p3: kotlin.Long, /*3*/ p4: kotlin.Long, /*4*/ p5: kotlin.Int) + public final val p1: kotlin.Int + public final val p2: kotlin.Int + public final val p3: kotlin.Long + public final val p4: kotlin.Long + public final val p5: kotlin.Int + 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 + } + + @test.Ann(p1 = -2147483648, p2 = 2, p3 = -2147483648, p4 = 2, p5 = 2) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.fir.kt new file mode 100644 index 00000000000..5caa2e2fc5f --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b: Byte, + val s: Short, + val i: Int, + val l: Long +) + +@Ann(1 * 1, 1 * 1, 1 * 1, 1 * 1) class MyClass + +// EXPECTED: @Ann(b = 1.toByte(), i = 1, l = 1.toLong(), s = 1.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.kt index c1f3dc0a43c..8a6659a1e71 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.kt @@ -7,6 +7,6 @@ annotation class Ann( val l: Long ) -@Ann(1 * 1, 1 * 1, 1 * 1, 1 * 1) class MyClass +@Ann(1 * 1, 1 * 1, 1 * 1, 1 * 1) class MyClass // EXPECTED: @Ann(b = 1.toByte(), i = 1, l = 1.toLong(), s = 1.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.txt new file mode 100644 index 00000000000..bac4c4ac40e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/miltiply.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b: kotlin.Byte, /*1*/ s: kotlin.Short, /*2*/ i: kotlin.Int, /*3*/ l: kotlin.Long) + public final val b: kotlin.Byte + public final val i: kotlin.Int + public final val l: kotlin.Long + public final val s: kotlin.Short + 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 + } + + @test.Ann(b = 1.toByte(), i = 1, l = 1.toLong(), s = 1.toShort()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.fir.kt new file mode 100644 index 00000000000..508da83b31d --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b: Byte, + val s: Short, + val i: Int, + val l: Long +) + +@Ann(1 - 1, 1 - 1, 1 - 1, 1 - 1) class MyClass + +// EXPECTED: @Ann(b = 0.toByte(), i = 0, l = 0.toLong(), s = 0.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.kt index 08c85c0f300..2b3f6bd5bdd 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.kt @@ -7,6 +7,6 @@ annotation class Ann( val l: Long ) -@Ann(1 - 1, 1 - 1, 1 - 1, 1 - 1) class MyClass +@Ann(1 - 1, 1 - 1, 1 - 1, 1 - 1) class MyClass // EXPECTED: @Ann(b = 0.toByte(), i = 0, l = 0.toLong(), s = 0.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.txt new file mode 100644 index 00000000000..f3d8164814a --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/minus.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b: kotlin.Byte, /*1*/ s: kotlin.Short, /*2*/ i: kotlin.Int, /*3*/ l: kotlin.Long) + public final val b: kotlin.Byte + public final val i: kotlin.Int + public final val l: kotlin.Long + public final val s: kotlin.Short + 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 + } + + @test.Ann(b = 0.toByte(), i = 0, l = 0.toLong(), s = 0.toShort()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.fir.kt new file mode 100644 index 00000000000..011ccf678fd --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b: Byte, + val s: Short, + val i: Int, + val l: Long +) + +@Ann(1 % 1, 1 % 1, 1 % 1, 1 % 1) class MyClass + +// EXPECTED: @Ann(b = 0.toByte(), i = 0, l = 0.toLong(), s = 0.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.kt index 8b7a179e49d..b01fcaef129 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.kt @@ -7,6 +7,6 @@ annotation class Ann( val l: Long ) -@Ann(1 % 1, 1 % 1, 1 % 1, 1 % 1) class MyClass +@Ann(1 % 1, 1 % 1, 1 % 1, 1 % 1) class MyClass // EXPECTED: @Ann(b = 0.toByte(), i = 0, l = 0.toLong(), s = 0.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.txt new file mode 100644 index 00000000000..f3d8164814a --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/mod.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b: kotlin.Byte, /*1*/ s: kotlin.Short, /*2*/ i: kotlin.Int, /*3*/ l: kotlin.Long) + public final val b: kotlin.Byte + public final val i: kotlin.Int + public final val l: kotlin.Long + public final val s: kotlin.Short + 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 + } + + @test.Ann(b = 0.toByte(), i = 0, l = 0.toLong(), s = 0.toShort()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/multilineString.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/multilineString.kt index 4d37ab4a9e4..c2bc54590e0 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/multilineString.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/multilineString.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann(val s1: String) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/multilineString.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/multilineString.txt new file mode 100644 index 00000000000..246d87213ca --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/multilineString.txt @@ -0,0 +1,19 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ s1: kotlin.String) + public final val s1: kotlin.String + 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 + } + + @test.Ann(s1 = "ab") public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/not.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/not.kt index a1400785d58..a4ca8d6abde 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/not.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/not.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( @@ -6,6 +7,6 @@ annotation class Ann( val b3: Boolean ) -@Ann(!true, !false) class MyClass +@Ann(!true, !false) class MyClass // EXPECTED: @Ann(b1 = false, b2 = true) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/not.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/not.txt new file mode 100644 index 00000000000..b3b824e6d55 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/not.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean, /*2*/ b3: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + public final val b3: kotlin.Boolean + 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 + } + + @test.Ann(b1 = false, b2 = true) public final class MyClass { + public constructor MyClass() + 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 + } +} + diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/noteq.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/noteq.kt index 6d3089279d0..8e30d071c27 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/noteq.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/noteq.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/noteq.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/noteq.txt new file mode 100644 index 00000000000..fa945de3673 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/noteq.txt @@ -0,0 +1,23 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean, /*2*/ b3: kotlin.Boolean, /*3*/ b4: kotlin.Boolean, /*4*/ b5: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + public final val b3: kotlin.Boolean + public final val b4: kotlin.Boolean + public final val b5: kotlin.Boolean + 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 + } + + @test.Ann(b1 = true, b2 = true, b3 = true, b4 = true, b5 = false) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/orOr.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/orOr.kt index 68b1156fa57..ee84786c9c2 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/orOr.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/orOr.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/orOr.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/orOr.txt new file mode 100644 index 00000000000..fe1982dbe0e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/orOr.txt @@ -0,0 +1,20 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Boolean, /*1*/ b2: kotlin.Boolean) + public final val b1: kotlin.Boolean + public final val b2: kotlin.Boolean + 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 + } + + @test.Ann(b1 = true, b2 = true) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/paranthesized.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/paranthesized.kt index 880bcaaa01d..a7a0fcfba77 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/paranthesized.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/paranthesized.kt @@ -1,6 +1,7 @@ +// FIR_IDENTICAL package test -annotation class Ann(i: Int) +annotation class Ann(i: Int) @Ann((1 + 2) * 2) class MyClass diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/paranthesized.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/paranthesized.txt new file mode 100644 index 00000000000..c2d02c9fdbf --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/paranthesized.txt @@ -0,0 +1,18 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ i: kotlin.Int) + 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 + } + + @test.Ann(i = 6) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.fir.kt new file mode 100644 index 00000000000..10631a91129 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b: Byte, + val s: Short, + val i: Int, + val l: Long +) + +@Ann(1 + 1, 1 + 1, 1 + 1, 1 + 1) class MyClass + +// EXPECTED: @Ann(b = 2.toByte(), i = 2, l = 2.toLong(), s = 2.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.kt index 5db73bb8ebb..3c641b25105 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.kt @@ -7,6 +7,6 @@ annotation class Ann( val l: Long ) -@Ann(1 + 1, 1 + 1, 1 + 1, 1 + 1) class MyClass +@Ann(1 + 1, 1 + 1, 1 + 1, 1 + 1) class MyClass // EXPECTED: @Ann(b = 2.toByte(), i = 2, l = 2.toLong(), s = 2.toShort()) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.txt new file mode 100644 index 00000000000..ceddfd200e4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/plus.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b: kotlin.Byte, /*1*/ s: kotlin.Short, /*2*/ i: kotlin.Int, /*3*/ l: kotlin.Long) + public final val b: kotlin.Byte + public final val i: kotlin.Int + public final val l: kotlin.Long + public final val s: kotlin.Short + 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 + } + + @test.Ann(b = 2.toByte(), i = 2, l = 2.toLong(), s = 2.toShort()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/simpleCallBinary.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/simpleCallBinary.kt index 7f990396ef5..861d2e6d8cb 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/simpleCallBinary.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/simpleCallBinary.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/simpleCallBinary.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/simpleCallBinary.txt new file mode 100644 index 00000000000..a90a4b651dd --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/simpleCallBinary.txt @@ -0,0 +1,23 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ p1: kotlin.Int, /*1*/ p2: kotlin.Int, /*2*/ p3: kotlin.Int, /*3*/ p4: kotlin.Int, /*4*/ p5: kotlin.Int) + public final val p1: kotlin.Int + public final val p2: kotlin.Int + public final val p3: kotlin.Int + public final val p4: kotlin.Int + public final val p5: kotlin.Int + 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 + } + + @test.Ann(p1 = 2, p2 = 0, p3 = 1, p4 = 1, p5 = 0) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringPlusInt.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringPlusInt.kt index 63d1b3fd837..6a378a56312 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringPlusInt.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringPlusInt.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann(val s1: String) diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringPlusInt.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringPlusInt.txt new file mode 100644 index 00000000000..35074573709 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringPlusInt.txt @@ -0,0 +1,19 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ s1: kotlin.String) + public final val s1: kotlin.String + 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 + } + + @test.Ann(s1 = "a1") public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.fir.kt new file mode 100644 index 00000000000..148a13432fc --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.fir.kt @@ -0,0 +1,19 @@ +package test + +annotation class Ann( + val s1: String, + val s2: String, + val s3: String, + val s4: String +) + +val i = 1 + +@Ann( + s1 = "a$i", + s2 = "a$i b", + s3 = "$i", + s4 = "a${i}a$i" +) class MyClass + +// EXPECTED: @Ann(s1 = "a1", s2 = "a1 b", s3 = "1", s4 = "a1a1") diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.kt index 8ff33442959..b62292155e7 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.kt @@ -10,10 +10,10 @@ annotation class Ann( val i = 1 @Ann( - s1 = "a$i", - s2 = "a$i b", - s3 = "$i", - s4 = "a${i}a$i" + s1 = "a$i", + s2 = "a$i b", + s3 = "$i", + s4 = "a${i}a$i" ) class MyClass // EXPECTED: @Ann(s1 = "a1", s2 = "a1 b", s3 = "1", s4 = "a1a1") diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.txt new file mode 100644 index 00000000000..e802acb5afd --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/stringTemplate.txt @@ -0,0 +1,23 @@ +package + +package test { + public val i: kotlin.Int = 1 + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ s1: kotlin.String, /*1*/ s2: kotlin.String, /*2*/ s3: kotlin.String, /*3*/ s4: kotlin.String) + public final val s1: kotlin.String + public final val s2: kotlin.String + public final val s3: kotlin.String + public final val s4: kotlin.String + 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 + } + + @test.Ann(s1 = "a1", s2 = "a1 b", s3 = "1", s4 = "a1a1") public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.fir.kt new file mode 100644 index 00000000000..ae6987c7bfb --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.fir.kt @@ -0,0 +1,9 @@ +package test + +annotation class Ann(val s1: String, val s2: String) + +val i = 1 + +@Ann(s1 = "a" + "b", s2 = "a" + "a$i") class MyClass + +// EXPECTED: @Ann(s1 = "ab", s2 = "aa1") diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.kt index ae6987c7bfb..1625ef42576 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.kt @@ -4,6 +4,6 @@ annotation class Ann(val s1: String, val s2: String) val i = 1 -@Ann(s1 = "a" + "b", s2 = "a" + "a$i") class MyClass +@Ann(s1 = "a" + "b", s2 = "a" + "a$i") class MyClass // EXPECTED: @Ann(s1 = "ab", s2 = "aa1") diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.txt new file mode 100644 index 00000000000..b02e26609de --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/strings.txt @@ -0,0 +1,21 @@ +package + +package test { + public val i: kotlin.Int = 1 + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ s1: kotlin.String, /*1*/ s2: kotlin.String) + public final val s1: kotlin.String + public final val s2: kotlin.String + 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 + } + + @test.Ann(s1 = "ab", s2 = "aa1") public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryMinus.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryMinus.kt index f2e251ee2ce..0c28709db1c 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryMinus.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryMinus.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryMinus.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryMinus.txt new file mode 100644 index 00000000000..2e4f2608961 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryMinus.txt @@ -0,0 +1,24 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Byte, /*1*/ b2: kotlin.Short, /*2*/ b3: kotlin.Int, /*3*/ b4: kotlin.Long, /*4*/ b5: kotlin.Double, /*5*/ b6: kotlin.Float) + public final val b1: kotlin.Byte + public final val b2: kotlin.Short + public final val b3: kotlin.Int + public final val b4: kotlin.Long + public final val b5: kotlin.Double + public final val b6: kotlin.Float + 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 + } + + @test.Ann(b1 = -1.toByte(), b2 = -1.toShort(), b3 = -1, b4 = -1.toLong(), b5 = -1.0.toDouble(), b6 = -1.0.toFloat()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryPlus.kt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryPlus.kt index 5105a863979..7102f9b29e2 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryPlus.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryPlus.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryPlus.txt b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryPlus.txt new file mode 100644 index 00000000000..85ebda756a0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/expressions/unaryPlus.txt @@ -0,0 +1,24 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Byte, /*1*/ b2: kotlin.Short, /*2*/ b3: kotlin.Int, /*3*/ b4: kotlin.Long, /*4*/ b5: kotlin.Double, /*5*/ b6: kotlin.Float) + public final val b1: kotlin.Byte + public final val b2: kotlin.Short + public final val b3: kotlin.Int + public final val b4: kotlin.Long + public final val b5: kotlin.Double + public final val b6: kotlin.Float + 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 + } + + @test.Ann(b1 = 1.toByte(), b2 = 1.toShort(), b3 = 1, b4 = 1.toLong(), b5 = 1.0.toDouble(), b6 = 1.0.toFloat()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/float.kt b/compiler/testData/diagnostics/tests/annotations/parameters/float.kt index 066e26f1014..939b7b29c52 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/float.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/float.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/float.txt b/compiler/testData/diagnostics/tests/annotations/parameters/float.txt new file mode 100644 index 00000000000..19800c7ac97 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/float.txt @@ -0,0 +1,20 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Float, /*1*/ b2: kotlin.Float) + public final val b1: kotlin.Float + public final val b2: kotlin.Float + 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 + } + + @test.Ann(b1 = 1.0.toFloat(), b2 = 1.0.toFloat()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/int.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/int.fir.kt new file mode 100644 index 00000000000..0fe9ed70663 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/int.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b1: Int, + val b2: Int, + val b3: Int, + val b4: Int +) + +@Ann(1, 1.toInt(), 2147483648.toInt(), 2147483648) class MyClass + +// EXPECTED: @Ann(b1 = 1, b2 = 1, b3 = -2147483648, b4 = 2147483648.toLong()) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/int.kt b/compiler/testData/diagnostics/tests/annotations/parameters/int.kt index 2d7ba1366ef..f65fd5948fd 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/int.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/int.kt @@ -7,6 +7,6 @@ annotation class Ann( val b4: Int ) -@Ann(1, 1.toInt(), 2147483648.toInt(), 2147483648) class MyClass +@Ann(1, 1.toInt(), 2147483648.toInt(), 2147483648) class MyClass // EXPECTED: @Ann(b1 = 1, b2 = 1, b3 = -2147483648, b4 = 2147483648.toLong()) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/int.txt b/compiler/testData/diagnostics/tests/annotations/parameters/int.txt new file mode 100644 index 00000000000..69737c5be2b --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/int.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Int, /*1*/ b2: kotlin.Int, /*2*/ b3: kotlin.Int, /*3*/ b4: kotlin.Int) + public final val b1: kotlin.Int + public final val b2: kotlin.Int + public final val b3: kotlin.Int + public final val b4: kotlin.Int + 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 + } + + @test.Ann(b1 = 1, b2 = 1, b3 = -2147483648, b4 = 2147483648.toLong()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/long.kt b/compiler/testData/diagnostics/tests/annotations/parameters/long.kt index 716c261da68..69b6f880136 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/long.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/long.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class Ann( diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/long.txt b/compiler/testData/diagnostics/tests/annotations/parameters/long.txt new file mode 100644 index 00000000000..9f82131a281 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/long.txt @@ -0,0 +1,20 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Long, /*1*/ b2: kotlin.Long) + public final val b1: kotlin.Long + public final val b2: kotlin.Long + 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 + } + + @test.Ann(b1 = 1.toLong(), b2 = 1.toLong()) public final class MyClass { + public constructor MyClass() + 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 + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/short.fir.kt b/compiler/testData/diagnostics/tests/annotations/parameters/short.fir.kt new file mode 100644 index 00000000000..12270200953 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/short.fir.kt @@ -0,0 +1,12 @@ +package test + +annotation class Ann( + val b1: Short, + val b2: Short, + val b3: Short, + val b4: Short +) + +@Ann(1, 1.toShort(), 32768.toShort(), 32768) class MyClass + +// EXPECTED: @Ann(b1 = 1.toShort(), b2 = 1.toShort(), b3 = -32768.toShort(), b4 = 32768) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/short.kt b/compiler/testData/diagnostics/tests/annotations/parameters/short.kt index 65594928010..f699ad75867 100644 --- a/compiler/testData/diagnostics/tests/annotations/parameters/short.kt +++ b/compiler/testData/diagnostics/tests/annotations/parameters/short.kt @@ -7,6 +7,6 @@ annotation class Ann( val b4: Short ) -@Ann(1, 1.toShort(), 32768.toShort(), 32768) class MyClass +@Ann(1, 1.toShort(), 32768.toShort(), 32768) class MyClass // EXPECTED: @Ann(b1 = 1.toShort(), b2 = 1.toShort(), b3 = -32768.toShort(), b4 = 32768) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/parameters/short.txt b/compiler/testData/diagnostics/tests/annotations/parameters/short.txt new file mode 100644 index 00000000000..f544340f998 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/parameters/short.txt @@ -0,0 +1,22 @@ +package + +package test { + + public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ b1: kotlin.Short, /*1*/ b2: kotlin.Short, /*2*/ b3: kotlin.Short, /*3*/ b4: kotlin.Short) + public final val b1: kotlin.Short + public final val b2: kotlin.Short + public final val b3: kotlin.Short + public final val b4: kotlin.Short + 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 + } + + @test.Ann(b1 = 1.toShort(), b2 = 1.toShort(), b3 = -32768.toShort(), b4 = 32768) public final class MyClass { + public constructor MyClass() + 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 + } +}