Skip to content

Commit

Permalink
K1/K2: add tests for KT-65441 current behavior
Browse files Browse the repository at this point in the history
(cherry picked from commit d870d9d)
  • Loading branch information
mglukhikh authored and qodana-bot committed Feb 29, 2024
1 parent c262b97 commit c041815
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
// ISSUE: KT-64640
// ISSUE: KT-64640, KT-65441
// WITH_STDLIB

fun bar(x: List<String>) {
x.<!UNRESOLVED_REFERENCE!>addFirst<!>("")
x.<!UNRESOLVED_REFERENCE!>addLast<!>("")
x.<!UNRESOLVED_REFERENCE!>removeFirst<!>()
x.<!UNRESOLVED_REFERENCE!>removeLast<!>()
x.<!UNRESOLVED_REFERENCE!>getFirst<!>()
x.<!UNRESOLVED_REFERENCE!>getLast<!>()
x.<!FUNCTION_CALL_EXPECTED!>first<!>
x.<!FUNCTION_CALL_EXPECTED!>last<!>
}

// Additional test for other SequenceCollection inheritor
Expand All @@ -14,9 +18,17 @@ fun baz(x: ArrayDeque<String>, y: LinkedHashSet<String>) {
x.addLast("")
x.removeFirst()
x.removeLast()
x.<!UNRESOLVED_REFERENCE!>getFirst<!>()
x.<!UNRESOLVED_REFERENCE!>getLast<!>()
x.<!FUNCTION_CALL_EXPECTED!>first<!>
x.<!FUNCTION_CALL_EXPECTED!>last<!>

x.addFirst("")
x.addLast("")
x.removeFirst()
x.removeLast()
y.addFirst("")
y.addLast("")
y.removeFirst()
y.removeLast()
y.getFirst()
y.getLast()
y.first
y.last
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
// ISSUE: KT-64640
// ISSUE: KT-64640, KT-65441
// WITH_STDLIB

fun bar(x: List<String>) {
x.<!UNRESOLVED_REFERENCE!>addFirst<!>("")
x.<!UNRESOLVED_REFERENCE!>addLast<!>("")
x.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>removeFirst<!>()
x.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>removeLast<!>()
x.<!DEPRECATION, JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE!>getFirst<!>()
x.<!DEPRECATION, JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE!>getLast<!>()
x.<!DEPRECATION!>first<!>
x.<!DEPRECATION!>last<!>
}

// Additional test for other SequenceCollection inheritor
Expand All @@ -14,9 +18,17 @@ fun baz(x: ArrayDeque<String>, y: LinkedHashSet<String>) {
x.addLast("")
x.removeFirst()
x.removeLast()
x.<!DEPRECATION!>getFirst<!>()
x.<!DEPRECATION!>getLast<!>()
x.<!DEPRECATION!>first<!>
x.<!DEPRECATION!>last<!>

x.addFirst("")
x.addLast("")
x.removeFirst()
x.removeLast()
y.addFirst("")
y.addLast("")
y.removeFirst()
y.removeLast()
y.getFirst()
y.getLast()
y.first
y.last
}

0 comments on commit c041815

Please sign in to comment.