K2: add a pair of KJ tests related to KT-64846 but w/out explicit override
This commit is contained in:
committed by
Space Team
parent
c0e0b4d32b
commit
49ec30735c
+24
@@ -0,0 +1,24 @@
|
||||
// FIR_IDENTICAL
|
||||
// SCOPE_DUMP: KA:get
|
||||
|
||||
// FILE: A.java
|
||||
abstract public class A implements CharSequence {
|
||||
public final int length() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public char charAt(int index) {
|
||||
return ' ';
|
||||
}
|
||||
|
||||
public char get(int index) {
|
||||
return 'X';
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
abstract class KA : A()
|
||||
|
||||
fun foo(a: A, ka: KA) {
|
||||
ka.get(0)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
KA:
|
||||
[Enhancement]: public open operator fun get(index: R|kotlin/Int|): R|kotlin/Char| from Use site scope of /KA [id: 0]
|
||||
[Enhancement]: public open operator fun get(index: R|kotlin/Int|): R|kotlin/Char| from Java enhancement scope for /A [id: 0]
|
||||
[Enhancement]: /* hidden due to clash */ public open operator fun get(index: R|kotlin/Int|): R|kotlin/Char| from Use site scope of /KA [id: 0]
|
||||
[Enhancement]: /* hidden due to clash */ public open operator fun get(index: R|kotlin/Int|): R|kotlin/Char| from Java enhancement scope for /A [id: 0]
|
||||
[Library]: public abstract operator fun get(index: R|kotlin/Int|): R|kotlin/Char| from Use site scope of kotlin/CharSequence [id: 1]
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
|
||||
// SCOPE_DUMP: KA:contains
|
||||
|
||||
// FILE: A.java
|
||||
abstract public class A implements java.util.Collection<String> {
|
||||
public boolean contains(Object x) {return false;}
|
||||
public boolean contains(String x) {return false;}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
abstract class KA : A()
|
||||
|
||||
fun foo(a: A, ka: KA) {
|
||||
ka.contains("")
|
||||
ka.contains(<!ARGUMENT_TYPE_MISMATCH!>1<!>)
|
||||
"" in ka
|
||||
<!ARGUMENT_TYPE_MISMATCH!>1<!> in ka
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
KA:
|
||||
[Enhancement]: public open operator fun contains(x: R|kotlin/String!|): R|kotlin/Boolean| from Use site scope of /KA [id: 0]
|
||||
[Enhancement]: public open operator fun contains(x: R|kotlin/String!|): R|kotlin/Boolean| from Java enhancement scope for /A [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun contains(element: R|kotlin/String!|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableCollection] for type A [id: 1]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun contains(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableCollection [id: 2]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun contains(element: R|E|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/Collection] for type kotlin/collections/MutableCollection<E> [id: 2]
|
||||
[Library]: public abstract operator fun contains(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/Collection [id: 3]
|
||||
[Enhancement]: /* hidden due to clash */ public open operator fun contains(x: R|kotlin/String!|): R|kotlin/Boolean| from Use site scope of /KA [id: 0]
|
||||
[Enhancement]: /* hidden due to clash */ public open operator fun contains(x: R|kotlin/String!|): R|kotlin/Boolean| from Java enhancement scope for /A [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun contains(element: R|kotlin/String!|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableCollection] for type A [id: 1]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun contains(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableCollection [id: 2]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract operator fun contains(element: R|E|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/Collection] for type kotlin/collections/MutableCollection<E> [id: 2]
|
||||
[Library]: public abstract operator fun contains(element: R|E|): R|kotlin/Boolean| from Use site scope of kotlin/collections/Collection [id: 3]
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
|
||||
// SCOPE_DUMP: KA:contains
|
||||
|
||||
// FILE: A.java
|
||||
abstract public class A implements java.util.Collection<String> {
|
||||
public boolean contains(Object x) {return false;}
|
||||
public boolean contains(String x) {return false;}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
abstract class KA : A()
|
||||
|
||||
fun foo(a: A, ka: KA) {
|
||||
ka.contains("")
|
||||
ka.contains(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
|
||||
"" in ka
|
||||
<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!> in ka
|
||||
}
|
||||
Reference in New Issue
Block a user