[FIR] Report errors about type arguments on resolved qualifiers
^KT-56186 Fixed ^KT-56187 Fixed ^KT-59553
This commit is contained in:
committed by
Space Team
parent
1b24b95cde
commit
6c7eb0167c
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-220
|
||||
* PRIMARY LINKS: expressions, call-and-property-access-expressions, callable-references -> paragraph 3 -> sentence 1
|
||||
*/
|
||||
fun f1() = Map::hashCode
|
||||
fun f2() = Map.Entry::hashCode
|
||||
|
||||
class Outer<T> {
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
fun f3() = Outer.Inner::hashCode
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// ISSUE: KT-56187
|
||||
|
||||
class Foo<T : Number> {
|
||||
val value: String = "OK"
|
||||
val genericValue: T = null!!
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val a = Foo<<!UPPER_BOUND_VIOLATED!>String<!>>::value
|
||||
val b = Foo<<!UPPER_BOUND_VIOLATED!>String<!>>::genericValue
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// WITH_STDLIB
|
||||
// ISSUE: KT-56186
|
||||
|
||||
class Foo<I, J : Number, K> {
|
||||
val value: String = "OK"
|
||||
val genericValue: Triple<I, J, K> = TODO()
|
||||
}
|
||||
|
||||
fun test_1() {
|
||||
val a = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<!>::value
|
||||
val b = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<String><!>::value
|
||||
val c = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<!>::genericValue
|
||||
val d = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<String><!>::genericValue
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// WITH_STDLIB
|
||||
// ISSUE: KT-56186
|
||||
|
||||
class Foo<I, J : Number, K> {
|
||||
val value: String = "OK"
|
||||
val genericValue: Triple<I, J, K> = TODO()
|
||||
}
|
||||
|
||||
fun test_1() {
|
||||
val a = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<!>::value
|
||||
val b = Foo<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>value<!>
|
||||
val c = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<!>::genericValue
|
||||
val d = Foo<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>genericValue<!>
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
class Some { fun foo() {} }
|
||||
|
||||
typealias SomeAlias = Some
|
||||
typealias SomeUnusedAlias<T> = Some
|
||||
|
||||
fun test_1() {
|
||||
Some::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Some<Int><!>::foo
|
||||
|
||||
SomeAlias::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>SomeAlias<Int><!>::foo
|
||||
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>SomeUnusedAlias<!>::foo
|
||||
SomeUnusedAlias<Int>::foo
|
||||
SomeUnusedAlias<out Int>::foo
|
||||
SomeUnusedAlias<in Int>::foo
|
||||
SomeUnusedAlias<*>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>SomeUnusedAlias<Int, Int><!>::foo
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
class Inv<T : CharSequence> { fun foo() {} }
|
||||
|
||||
typealias InvAlias<T> = Inv<T>
|
||||
typealias InvUnusedCorrectAlias<T> = Inv<String>
|
||||
typealias InvUnusedIncorrectAlias<T> = Inv<<!UPPER_BOUND_VIOLATED!>Int<!>>
|
||||
typealias InvSpecificAlias = Inv<String>
|
||||
|
||||
fun test_2() {
|
||||
Inv<String>::foo
|
||||
Inv<<!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
Inv<*>::foo
|
||||
Inv<<!UPPER_BOUND_VIOLATED!>out Int<!>>::foo
|
||||
Inv<out String>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Inv<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Inv<String, String><!>::foo
|
||||
|
||||
InvAlias<String>::foo
|
||||
InvAlias<<!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
InvAlias<*>::foo
|
||||
InvAlias<<!UPPER_BOUND_VIOLATED!>out Int<!>>::foo
|
||||
InvAlias<out String>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvAlias<String, String><!>::foo
|
||||
|
||||
InvUnusedCorrectAlias<String>::foo
|
||||
InvUnusedCorrectAlias<Int>::foo
|
||||
InvUnusedCorrectAlias<*>::foo
|
||||
InvUnusedCorrectAlias<out Int>::foo
|
||||
InvUnusedCorrectAlias<out String>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvUnusedCorrectAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvUnusedCorrectAlias<String, String><!>::foo
|
||||
|
||||
InvUnusedIncorrectAlias<String>::foo
|
||||
InvUnusedIncorrectAlias<Int>::foo
|
||||
InvUnusedIncorrectAlias<*>::foo
|
||||
InvUnusedIncorrectAlias<out Int>::foo
|
||||
InvUnusedIncorrectAlias<out String>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvUnusedIncorrectAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvUnusedIncorrectAlias<String, String><!>::foo
|
||||
|
||||
InvSpecificAlias::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvSpecificAlias<String, String><!>::foo
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
class BoundedPair<T : CharSequence, Q> { fun foo() {} }
|
||||
|
||||
typealias BoundedPairAlias<T, Q> = BoundedPair<T, Q>
|
||||
typealias BoundedPairInverted<Q, T> = BoundedPair<T, Q>
|
||||
typealias BoundedPairFirstFixedAlias<Q> = BoundedPair<String, Q>
|
||||
typealias BoundedPairSecondFixedAlias<T> = BoundedPair<T, Int>
|
||||
typealias BoundedPairFirstUnusedAlias<T, Q> = BoundedPair<String, Q>
|
||||
typealias BoundedPairSecondUnusedAlias<T, Q> = BoundedPair<T, Int>
|
||||
typealias BoundedPairBothAlias<T, Q> = BoundedPair<String, Int>
|
||||
typealias BoundedPairSpecificAlias<T, Q> = BoundedPair<String, Int>
|
||||
|
||||
fun test_3() {
|
||||
BoundedPair<String, Int>::foo
|
||||
BoundedPair<<!UPPER_BOUND_VIOLATED!>Int<!>, Int>::foo
|
||||
BoundedPair<*, *>::foo
|
||||
BoundedPair<out String, out Int>::foo
|
||||
BoundedPair<<!UPPER_BOUND_VIOLATED!>out Int<!>, out Int>::foo
|
||||
BoundedPair<in String, in Int>::foo
|
||||
BoundedPair<<!UPPER_BOUND_VIOLATED!>in Int<!>, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPair<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPair<Int, Int, Int><!>::foo
|
||||
|
||||
BoundedPairAlias<String, Int>::foo
|
||||
BoundedPairAlias<<!UPPER_BOUND_VIOLATED!>Int<!>, Int>::foo
|
||||
BoundedPairAlias<*, *>::foo
|
||||
BoundedPairAlias<out String, out Int>::foo
|
||||
BoundedPairAlias<<!UPPER_BOUND_VIOLATED!>out Int<!>, out Int>::foo
|
||||
BoundedPairAlias<in String, in Int>::foo
|
||||
BoundedPairAlias<<!UPPER_BOUND_VIOLATED!>in Int<!>, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairAlias<Int, Int, Int><!>::foo
|
||||
|
||||
BoundedPairInverted<String, <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairInverted<Int, <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairInverted<*, *>::foo
|
||||
BoundedPairInverted<out String, <!UPPER_BOUND_VIOLATED!>out Int<!>>::foo
|
||||
BoundedPairInverted<out Int, <!UPPER_BOUND_VIOLATED!>out Int<!>>::foo
|
||||
BoundedPairInverted<in String, <!UPPER_BOUND_VIOLATED!>in Int<!>>::foo
|
||||
BoundedPairInverted<in Int, <!UPPER_BOUND_VIOLATED!>in Int<!>>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairInverted<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairInverted<Int, Int, Int><!>::foo
|
||||
|
||||
BoundedPairFirstFixedAlias<Int>::foo
|
||||
BoundedPairFirstFixedAlias<Int>::foo
|
||||
BoundedPairFirstFixedAlias<*>::foo
|
||||
BoundedPairFirstFixedAlias<out String>::foo
|
||||
BoundedPairFirstFixedAlias<out Int>::foo
|
||||
BoundedPairFirstFixedAlias<in String>::foo
|
||||
BoundedPairFirstFixedAlias<in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairFirstFixedAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairFirstFixedAlias<Int, Int><!>::foo
|
||||
|
||||
BoundedPairSecondFixedAlias<<!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairSecondFixedAlias<<!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairSecondFixedAlias<*>::foo
|
||||
BoundedPairSecondFixedAlias<out String>::foo
|
||||
BoundedPairSecondFixedAlias<<!UPPER_BOUND_VIOLATED!>out Int<!>>::foo
|
||||
BoundedPairSecondFixedAlias<in String>::foo
|
||||
BoundedPairSecondFixedAlias<<!UPPER_BOUND_VIOLATED!>in Int<!>>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSecondFixedAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSecondFixedAlias<Int, Int><!>::foo
|
||||
|
||||
BoundedPairFirstUnusedAlias<String, Int>::foo
|
||||
BoundedPairFirstUnusedAlias<Int, Int>::foo
|
||||
BoundedPairFirstUnusedAlias<*, *>::foo
|
||||
BoundedPairFirstUnusedAlias<out String, out Int>::foo
|
||||
BoundedPairFirstUnusedAlias<out Int, out Int>::foo
|
||||
BoundedPairFirstUnusedAlias<in String, in Int>::foo
|
||||
BoundedPairFirstUnusedAlias<in Int, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairFirstUnusedAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairFirstUnusedAlias<Int, Int, Int><!>::foo
|
||||
|
||||
BoundedPairSecondUnusedAlias<String, Int>::foo
|
||||
BoundedPairSecondUnusedAlias<<!UPPER_BOUND_VIOLATED!>Int<!>, Int>::foo
|
||||
BoundedPairSecondUnusedAlias<*, *>::foo
|
||||
BoundedPairSecondUnusedAlias<out String, out Int>::foo
|
||||
BoundedPairSecondUnusedAlias<<!UPPER_BOUND_VIOLATED!>out Int<!>, out Int>::foo
|
||||
BoundedPairSecondUnusedAlias<in String, in Int>::foo
|
||||
BoundedPairSecondUnusedAlias<<!UPPER_BOUND_VIOLATED!>in Int<!>, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSecondUnusedAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSecondUnusedAlias<Int, Int, Int><!>::foo
|
||||
|
||||
BoundedPairBothAlias<String, Int>::foo
|
||||
BoundedPairBothAlias<Int, Int>::foo
|
||||
BoundedPairBothAlias<*, *>::foo
|
||||
BoundedPairBothAlias<out String, out Int>::foo
|
||||
BoundedPairBothAlias<out Int, out Int>::foo
|
||||
BoundedPairBothAlias<in String, in Int>::foo
|
||||
BoundedPairBothAlias<in Int, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairBothAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairBothAlias<Int, Int, Int><!>::foo
|
||||
|
||||
BoundedPairSpecificAlias<String, Int>::foo
|
||||
BoundedPairSpecificAlias<Int, Int>::foo
|
||||
BoundedPairSpecificAlias<*, *>::foo
|
||||
BoundedPairSpecificAlias<out String, out Int>::foo
|
||||
BoundedPairSpecificAlias<out Int, out Int>::foo
|
||||
BoundedPairSpecificAlias<in String, in Int>::foo
|
||||
BoundedPairSpecificAlias<in Int, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSpecificAlias<!>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSpecificAlias<Int, Int, Int><!>::foo
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
class Some { fun foo() {} }
|
||||
|
||||
typealias SomeAlias = Some
|
||||
typealias SomeUnusedAlias<T> = Some
|
||||
|
||||
fun test_1() {
|
||||
Some::foo
|
||||
Some<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
SomeAlias::foo
|
||||
SomeAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>SomeUnusedAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
SomeUnusedAlias<Int>::foo
|
||||
SomeUnusedAlias<out Int>::foo
|
||||
SomeUnusedAlias<in Int>::foo
|
||||
SomeUnusedAlias<*>::foo
|
||||
SomeUnusedAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
class Inv<T : CharSequence> { fun foo() {} }
|
||||
|
||||
typealias InvAlias<T> = Inv<T>
|
||||
typealias InvUnusedCorrectAlias<T> = Inv<String>
|
||||
typealias InvUnusedIncorrectAlias<T> = Inv<<!UPPER_BOUND_VIOLATED!>Int<!>>
|
||||
typealias InvSpecificAlias = Inv<String>
|
||||
|
||||
fun test_2() {
|
||||
Inv<String>::foo
|
||||
Inv<<!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
Inv<*>::foo
|
||||
Inv<out <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
Inv<out String>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Inv<!>::foo
|
||||
Inv<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String, String><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
InvAlias<String>::foo
|
||||
InvAlias<<!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
InvAlias<*>::foo
|
||||
InvAlias<out <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
InvAlias<out String>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvAlias<!>::foo
|
||||
InvAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String, String><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
InvUnusedCorrectAlias<String>::foo
|
||||
InvUnusedCorrectAlias<Int>::foo
|
||||
InvUnusedCorrectAlias<*>::foo
|
||||
InvUnusedCorrectAlias<out Int>::foo
|
||||
InvUnusedCorrectAlias<out String>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvUnusedCorrectAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
InvUnusedCorrectAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String, String><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
InvUnusedIncorrectAlias<String>::foo
|
||||
InvUnusedIncorrectAlias<Int>::foo
|
||||
InvUnusedIncorrectAlias<*>::foo
|
||||
InvUnusedIncorrectAlias<out Int>::foo
|
||||
InvUnusedIncorrectAlias<out String>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvUnusedIncorrectAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
InvUnusedIncorrectAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String, String><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
InvSpecificAlias::foo
|
||||
InvSpecificAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String, String><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
class BoundedPair<T : CharSequence, Q> { fun foo() {} }
|
||||
|
||||
typealias BoundedPairAlias<T, Q> = BoundedPair<T, Q>
|
||||
typealias BoundedPairInverted<Q, T> = BoundedPair<T, Q>
|
||||
typealias BoundedPairFirstFixedAlias<Q> = BoundedPair<String, Q>
|
||||
typealias BoundedPairSecondFixedAlias<T> = BoundedPair<T, Int>
|
||||
typealias BoundedPairFirstUnusedAlias<T, Q> = BoundedPair<String, Q>
|
||||
typealias BoundedPairSecondUnusedAlias<T, Q> = BoundedPair<T, Int>
|
||||
typealias BoundedPairBothAlias<T, Q> = BoundedPair<String, Int>
|
||||
typealias BoundedPairSpecificAlias<T, Q> = BoundedPair<String, Int>
|
||||
|
||||
fun test_3() {
|
||||
BoundedPair<String, Int>::foo
|
||||
BoundedPair<<!UPPER_BOUND_VIOLATED!>Int<!>, Int>::foo
|
||||
BoundedPair<*, *>::foo
|
||||
BoundedPair<out String, out Int>::foo
|
||||
BoundedPair<out <!UPPER_BOUND_VIOLATED!>Int<!>, out Int>::foo
|
||||
BoundedPair<in String, in Int>::foo
|
||||
BoundedPair<in <!UPPER_BOUND_VIOLATED!>Int<!>, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPair<!>::foo
|
||||
BoundedPair<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
BoundedPairAlias<String, Int>::foo
|
||||
BoundedPairAlias<<!UPPER_BOUND_VIOLATED!>Int<!>, Int>::foo
|
||||
BoundedPairAlias<*, *>::foo
|
||||
BoundedPairAlias<out String, out Int>::foo
|
||||
BoundedPairAlias<out <!UPPER_BOUND_VIOLATED!>Int<!>, out Int>::foo
|
||||
BoundedPairAlias<in String, in Int>::foo
|
||||
BoundedPairAlias<in <!UPPER_BOUND_VIOLATED!>Int<!>, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairAlias<!>::foo
|
||||
BoundedPairAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
BoundedPairInverted<String, <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairInverted<Int, <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairInverted<*, *>::foo
|
||||
BoundedPairInverted<out String, out <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairInverted<out Int, out <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairInverted<in String, in <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairInverted<in Int, in <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairInverted<!>::foo
|
||||
BoundedPairInverted<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
BoundedPairFirstFixedAlias<Int>::foo
|
||||
BoundedPairFirstFixedAlias<Int>::foo
|
||||
BoundedPairFirstFixedAlias<*>::foo
|
||||
BoundedPairFirstFixedAlias<out String>::foo
|
||||
BoundedPairFirstFixedAlias<out Int>::foo
|
||||
BoundedPairFirstFixedAlias<in String>::foo
|
||||
BoundedPairFirstFixedAlias<in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairFirstFixedAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
BoundedPairFirstFixedAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
BoundedPairSecondFixedAlias<<!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairSecondFixedAlias<<!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairSecondFixedAlias<*>::foo
|
||||
BoundedPairSecondFixedAlias<out String>::foo
|
||||
BoundedPairSecondFixedAlias<out <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
BoundedPairSecondFixedAlias<in String>::foo
|
||||
BoundedPairSecondFixedAlias<in <!UPPER_BOUND_VIOLATED!>Int<!>>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSecondFixedAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
BoundedPairSecondFixedAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
BoundedPairFirstUnusedAlias<String, Int>::foo
|
||||
BoundedPairFirstUnusedAlias<Int, Int>::foo
|
||||
BoundedPairFirstUnusedAlias<*, *>::foo
|
||||
BoundedPairFirstUnusedAlias<out String, out Int>::foo
|
||||
BoundedPairFirstUnusedAlias<out Int, out Int>::foo
|
||||
BoundedPairFirstUnusedAlias<in String, in Int>::foo
|
||||
BoundedPairFirstUnusedAlias<in Int, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairFirstUnusedAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
BoundedPairFirstUnusedAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
BoundedPairSecondUnusedAlias<String, Int>::foo
|
||||
BoundedPairSecondUnusedAlias<<!UPPER_BOUND_VIOLATED!>Int<!>, Int>::foo
|
||||
BoundedPairSecondUnusedAlias<*, *>::foo
|
||||
BoundedPairSecondUnusedAlias<out String, out Int>::foo
|
||||
BoundedPairSecondUnusedAlias<out <!UPPER_BOUND_VIOLATED!>Int<!>, out Int>::foo
|
||||
BoundedPairSecondUnusedAlias<in String, in Int>::foo
|
||||
BoundedPairSecondUnusedAlias<in <!UPPER_BOUND_VIOLATED!>Int<!>, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSecondUnusedAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
BoundedPairSecondUnusedAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
BoundedPairBothAlias<String, Int>::foo
|
||||
BoundedPairBothAlias<Int, Int>::foo
|
||||
BoundedPairBothAlias<*, *>::foo
|
||||
BoundedPairBothAlias<out String, out Int>::foo
|
||||
BoundedPairBothAlias<out Int, out Int>::foo
|
||||
BoundedPairBothAlias<in String, in Int>::foo
|
||||
BoundedPairBothAlias<in Int, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairBothAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
BoundedPairBothAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
BoundedPairSpecificAlias<String, Int>::foo
|
||||
BoundedPairSpecificAlias<Int, Int>::foo
|
||||
BoundedPairSpecificAlias<*, *>::foo
|
||||
BoundedPairSpecificAlias<out String, out Int>::foo
|
||||
BoundedPairSpecificAlias<out Int, out Int>::foo
|
||||
BoundedPairSpecificAlias<in String, in Int>::foo
|
||||
BoundedPairSpecificAlias<in Int, in Int>::foo
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>BoundedPairSpecificAlias<!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
BoundedPairSpecificAlias<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// WITH_STDLIB
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
class A
|
||||
@@ -17,4 +18,4 @@ inline fun <reified T : Any> bar() {
|
||||
val t3 = <!NULLABLE_TYPE_IN_CLASS_LITERAL_LHS!>T?::class<!>
|
||||
}
|
||||
|
||||
val m = Map<String>::class
|
||||
val m = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Map<String><!>::class
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// WITH_STDLIB
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
class A
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
class Inv<T>
|
||||
class Some
|
||||
class MyPair<A, B>
|
||||
|
||||
typealias InvAlias<T> = Inv<T>
|
||||
typealias InvUnused<T> = Inv<Int>
|
||||
typealias SomeAlias<T> = Some
|
||||
typealias PairAliasSingle<T> = MyPair<T, T>
|
||||
typealias PairAliasUsual<A, B> = MyPair<A, B>
|
||||
typealias PairAliasReversed<A, B> = MyPair<B, A>
|
||||
typealias PairAliasTwoWithUnused<A, B> = MyPair<A, A>
|
||||
typealias PairAliasSpecific = MyPair<Int, Int>
|
||||
typealias SimpleArrayAlias<T> = Array<T>
|
||||
typealias SpecificArrayAlias = Array<Int>
|
||||
typealias UnusedArrayAlias<T> = Array<Int>
|
||||
|
||||
fun test() {
|
||||
Inv::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>Inv<String>::class<!>
|
||||
|
||||
InvAlias::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>InvAlias<String>::class<!>
|
||||
|
||||
InvUnused::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>InvUnused<String>::class<!>
|
||||
|
||||
Some::class
|
||||
SomeAlias::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>SomeAlias<String>::class<!>
|
||||
|
||||
MyPair::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>MyPair<Int, Int>::class<!>
|
||||
|
||||
PairAliasSingle::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasSingle<Int>::class<!>
|
||||
|
||||
PairAliasReversed::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasReversed<Int, Int>::class<!>
|
||||
|
||||
PairAliasUsual::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasUsual<Int, Int>::class<!>
|
||||
|
||||
PairAliasSpecific::class
|
||||
|
||||
PairAliasTwoWithUnused::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasTwoWithUnused<Int, Int>::class<!>
|
||||
|
||||
Array::class
|
||||
Array<Int>::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>Array<*>::class<!>
|
||||
|
||||
SimpleArrayAlias::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>SimpleArrayAlias<Int>::class<!>
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>SimpleArrayAlias<*>::class<!>
|
||||
|
||||
SpecificArrayAlias::class
|
||||
|
||||
UnusedArrayAlias::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>UnusedArrayAlias<Int>::class<!>
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>UnusedArrayAlias<*>::class<!>
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
class Inv<T>
|
||||
class Some
|
||||
class MyPair<A, B>
|
||||
|
||||
typealias InvAlias<T> = Inv<T>
|
||||
typealias InvUnused<T> = Inv<Int>
|
||||
typealias SomeAlias<T> = Some
|
||||
typealias PairAliasSingle<T> = MyPair<T, T>
|
||||
typealias PairAliasUsual<A, B> = MyPair<A, B>
|
||||
typealias PairAliasReversed<A, B> = MyPair<B, A>
|
||||
typealias PairAliasTwoWithUnused<A, B> = MyPair<A, A>
|
||||
typealias PairAliasSpecific = MyPair<Int, Int>
|
||||
typealias SimpleArrayAlias<T> = Array<T>
|
||||
typealias SpecificArrayAlias = Array<Int>
|
||||
typealias UnusedArrayAlias<T> = Array<Int>
|
||||
|
||||
fun test() {
|
||||
Inv::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>Inv<String>::class<!>
|
||||
|
||||
InvAlias::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>InvAlias<String>::class<!>
|
||||
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>InvUnused<!>::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>InvUnused<String>::class<!>
|
||||
|
||||
Some::class
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>SomeAlias<!>::class
|
||||
SomeAlias<String>::class
|
||||
|
||||
MyPair::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>MyPair<Int, Int>::class<!>
|
||||
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>PairAliasSingle<!>::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasSingle<Int>::class<!>
|
||||
|
||||
PairAliasReversed::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasReversed<Int, Int>::class<!>
|
||||
|
||||
PairAliasUsual::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasUsual<Int, Int>::class<!>
|
||||
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasSpecific::class<!>
|
||||
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>PairAliasTwoWithUnused<!>::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>PairAliasTwoWithUnused<Int, Int>::class<!>
|
||||
|
||||
Array::class
|
||||
Array<Int>::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>Array<*>::class<!>
|
||||
|
||||
SimpleArrayAlias::class
|
||||
SimpleArrayAlias<Int>::class
|
||||
<!CLASS_LITERAL_LHS_NOT_A_CLASS!>SimpleArrayAlias<*>::class<!>
|
||||
|
||||
SpecificArrayAlias::class
|
||||
|
||||
<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>UnusedArrayAlias<!>::class
|
||||
UnusedArrayAlias<Int>::class
|
||||
UnusedArrayAlias<*>::class
|
||||
}
|
||||
Reference in New Issue
Block a user