Skip to content

Commit

Permalink
[IR] update testdata: improve annotations rendering in case when argu…
Browse files Browse the repository at this point in the history
…ment was not provided and there is default value
  • Loading branch information
bashor authored and teamcityserver committed Nov 25, 2020
1 parent a34a311 commit 87eb06a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fun test3() {
fun test4() {
}

@A()
@A
fun test5() {
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@JavaAnn()
@JavaAnn
fun test1() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,35 +62,35 @@ fun test1() {

fun test2() {
// COMPOSITE {
val tmp0_container: @FlexibleNullability Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String>? = notNullComponents()
val x: @NotNull() @EnhancedNullability String = tmp0_container /*!! Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String> */.component1()
val y: @NotNull() @EnhancedNullability String = tmp0_container /*!! Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String> */.component2()
val tmp0_container: @FlexibleNullability Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String>? = notNullComponents()
val x: @NotNull @EnhancedNullability String = tmp0_container /*!! Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String> */.component1()
val y: @NotNull @EnhancedNullability String = tmp0_container /*!! Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String> */.component2()
// }
use(x = x /*!! @NotNull() String */, y = y /*!! @NotNull() String */)
use(x = x /*!! @NotNull String */, y = y /*!! @NotNull String */)
}

fun test2Desugared() {
val tmp: @FlexibleNullability Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String>? = notNullComponents()
val x: @NotNull() String = tmp /*!! Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String> */.component1() /*!! @NotNull() String */
val y: @NotNull() String = tmp /*!! Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String> */.component2() /*!! @NotNull() String */
val tmp: @FlexibleNullability Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String>? = notNullComponents()
val x: @NotNull String = tmp /*!! Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String> */.component1() /*!! @NotNull String */
val y: @NotNull String = tmp /*!! Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String> */.component2() /*!! @NotNull String */
use(x = x, y = y)
}

fun test3() {
// COMPOSITE {
val tmp0_container: @EnhancedNullability Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String> = notNullQAndComponents()
val x: @NotNull() @EnhancedNullability String = tmp0_container /*!! Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String> */.component1()
val y: @NotNull() @EnhancedNullability String = tmp0_container /*!! Q<@NotNull() @EnhancedNullability String, @NotNull() @EnhancedNullability String> */.component2()
val tmp0_container: @EnhancedNullability Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String> = notNullQAndComponents()
val x: @NotNull @EnhancedNullability String = tmp0_container /*!! Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String> */.component1()
val y: @NotNull @EnhancedNullability String = tmp0_container /*!! Q<@NotNull @EnhancedNullability String, @NotNull @EnhancedNullability String> */.component2()
// }
use(x = x /*!! @NotNull() String */, y = y /*!! @NotNull() String */)
use(x = x /*!! @NotNull String */, y = y /*!! @NotNull String */)
}

fun test4() {
// COMPOSITE {
val tmp0_container: IndexedValue<@NotNull() @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull() @EnhancedNullability P> */.withIndex<@NotNull() @EnhancedNullability P>().first<IndexedValue<@NotNull() @EnhancedNullability P>>()
val tmp0_container: IndexedValue<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */.withIndex<@NotNull @EnhancedNullability P>().first<IndexedValue<@NotNull @EnhancedNullability P>>()
val x: Int = tmp0_container.component1()
val y: @NotNull() @EnhancedNullability P = tmp0_container.component2()
val y: @NotNull @EnhancedNullability P = tmp0_container.component2()
// }
use(x = x, y = y /*!! @NotNull() P */)
use(x = x, y = y /*!! @NotNull P */)
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ fun use(s: P) {

fun testForInListUnused() {
{ // BLOCK
val tmp0_iterator: MutableIterator<@NotNull() @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull() @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
val tmp0_iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val x: @NotNull() @EnhancedNullability P = tmp0_iterator.next()
val x: @NotNull @EnhancedNullability P = tmp0_iterator.next()
{ // BLOCK
}
}
Expand All @@ -14,21 +14,21 @@ fun testForInListUnused() {

fun testForInListDestructured() {
{ // BLOCK
val tmp0_iterator: MutableIterator<@NotNull() @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull() @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
val tmp0_iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val tmp1_loop_parameter: @NotNull() @EnhancedNullability P = tmp0_iterator.next()
val x: Int = tmp1_loop_parameter /*!! @NotNull() P */.component1()
val y: Int = tmp1_loop_parameter /*!! @NotNull() P */.component2()
val tmp1_loop_parameter: @NotNull @EnhancedNullability P = tmp0_iterator.next()
val x: Int = tmp1_loop_parameter /*!! @NotNull P */.component1()
val y: Int = tmp1_loop_parameter /*!! @NotNull P */.component2()
{ // BLOCK
}
}
}
}

fun testDesugaredForInList() {
val iterator: MutableIterator<@NotNull() @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull() @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
val iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
while (iterator.hasNext()) { // BLOCK
val x: @NotNull() P = iterator.next() /*!! @NotNull() P */
val x: @NotNull P = iterator.next() /*!! @NotNull P */
}
}

Expand All @@ -45,11 +45,11 @@ fun testForInArrayUnused(j: J) {

fun testForInListUse() {
{ // BLOCK
val tmp0_iterator: MutableIterator<@NotNull() @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull() @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
val tmp0_iterator: MutableIterator<@NotNull @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull @EnhancedNullability P> */ /*as MutableList<*> */.iterator()
while (tmp0_iterator.hasNext()) { // BLOCK
val x: @NotNull() @EnhancedNullability P = tmp0_iterator.next()
val x: @NotNull @EnhancedNullability P = tmp0_iterator.next()
{ // BLOCK
use(s = x /*!! @NotNull() P */)
use(s = x /*!! @NotNull P */)
use(s = x)
}
}
Expand Down

0 comments on commit 87eb06a

Please sign in to comment.