[FIR] By default, only hide members from mapped scope but not overrides

This affects methods like List.getFirst/getLast where it was decided
to keep them hidden but to make them visible on overrides like
ArrayList or LinkedList.
The goal is to prevent a breaking change since some implementations
like LinkedList had this method before JDK 21.

#KT-65438
This commit is contained in:
Kirill Rakhman
2024-02-02 18:20:47 +01:00
committed by Space Team
parent fbe8db4b45
commit fc6d25e50f
8 changed files with 45 additions and 50 deletions
@@ -1,11 +1,11 @@
fun foo(ll: java.util.LinkedList<String>, al: ArrayList<String>, ad: ArrayDeque<String>, jad: java.util.ArrayDeque<String>) {
ll.addFirst("")
ll.addLast("")
ll.<!UNRESOLVED_REFERENCE!>getFirst<!>()
ll.<!INVISIBLE_REFERENCE!>first<!> // synthetic property for getFirst()
ll.getFirst()
ll.first // synthetic property for getFirst()
ll.first() // stdlib extension on List
ll.<!UNRESOLVED_REFERENCE!>getLast<!>()
ll.<!INVISIBLE_REFERENCE!>last<!>
ll.getLast()
ll.last
ll.last()
ll.removeFirst()
ll.removeLast()
@@ -13,11 +13,11 @@ fun foo(ll: java.util.LinkedList<String>, al: ArrayList<String>, ad: ArrayDeque<
al.addFirst("")
al.addLast("")
al.<!UNRESOLVED_REFERENCE!>getFirst<!>()
al.<!FUNCTION_CALL_EXPECTED!>first<!>
al.getFirst()
al.first
al.first()
al.<!UNRESOLVED_REFERENCE!>getLast<!>()
al.<!FUNCTION_CALL_EXPECTED!>last<!>
al.getLast()
al.last
al.last()
al.removeFirst()
al.removeLast()