[FIR] Initialize outer type parameters for local classes
This commit is contained in:
committed by
TeamCityServer
parent
38820d3e41
commit
e52a410599
+4
-4
@@ -19,14 +19,14 @@ private class Outer<E> {
|
||||
private var doubleStringInt = Outer<Double>().Inner<String>().foo<Int>()()
|
||||
|
||||
private fun bar() {
|
||||
doubleCharSequenceInt = doubleStringNumber
|
||||
doubleCharSequenceInt = <!ASSIGNMENT_TYPE_MISMATCH!>doubleStringNumber<!>
|
||||
doubleCharSequenceInt = doubleStringInt
|
||||
|
||||
doubleStringInt = Outer<Double>().Inner<String>().foo<Int>()()
|
||||
|
||||
doubleStringInt.e.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Double>() }
|
||||
doubleStringInt.f.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
|
||||
doubleStringInt.g.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Int>() }
|
||||
doubleStringInt.e.checkType { _<Double>() }
|
||||
doubleStringInt.f.checkType { _<String>() }
|
||||
doubleStringInt.g.checkType { _<Int>() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -14,11 +14,11 @@ class Q {
|
||||
private var y = foo<String>()()
|
||||
|
||||
fun bar() {
|
||||
x = y
|
||||
x = <!ASSIGNMENT_TYPE_MISMATCH!>y<!>
|
||||
x = foo<CharSequence>()()
|
||||
y = foo<String>()()
|
||||
|
||||
x.prop.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><CharSequence>() }
|
||||
y.prop.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><String>() }
|
||||
x.prop.checkType { _<CharSequence>() }
|
||||
y.prop.checkType { _<String>() }
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -15,8 +15,8 @@ class Q {
|
||||
private var x = foo<CharSequence, Number>()()
|
||||
|
||||
fun bar() {
|
||||
x.e.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><CharSequence>() }
|
||||
x.f.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Number>() }
|
||||
x.e.checkType { _<CharSequence>() }
|
||||
x.f.checkType { _<Number>() }
|
||||
x.g.checkType { _<Number>() }
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,16 +1,16 @@
|
||||
fun <E> foo(x: Any, y: Any) : Any {
|
||||
class C
|
||||
// without E?
|
||||
if(x is C) {
|
||||
if(x is <!NO_TYPE_ARGUMENTS_ON_RHS!>C<!>) {
|
||||
return x
|
||||
}
|
||||
|
||||
if (1 == 2) {
|
||||
x as C
|
||||
x as <!NO_TYPE_ARGUMENTS_ON_RHS!>C<!>
|
||||
}
|
||||
|
||||
if (2 == 3) {
|
||||
x as? C
|
||||
x as? <!NO_TYPE_ARGUMENTS_ON_RHS, NO_TYPE_ARGUMENTS_ON_RHS!>C<!>
|
||||
}
|
||||
|
||||
class Outer<F> {
|
||||
|
||||
+2
-2
@@ -41,10 +41,10 @@ fun test() {
|
||||
var x = foobar<String>()
|
||||
x = foobar<String>()
|
||||
|
||||
x().foo().a() checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><A<String, Double, Short, Long>>() }
|
||||
x().foo().a() checkType { _<A<String, Double, Short, Long>>() }
|
||||
x().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<A<String, Double, Short, Char>>() }
|
||||
|
||||
x = foobar<Int>()
|
||||
x = <!ASSIGNMENT_TYPE_MISMATCH!>foobar<Int>()<!>
|
||||
|
||||
var y = noParameters()
|
||||
y = noParameters()
|
||||
|
||||
+3
-3
@@ -42,11 +42,11 @@ class Outer<T> {
|
||||
var x = foobar<String>()
|
||||
x = foobar<String>()
|
||||
|
||||
x().foo().a() checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><A<T, F, String, Double, Short, Long>>() }
|
||||
x().foo().a() checkType { _<A<T, F, String, Double, Short, Long>>() }
|
||||
x().bar() <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { _<A<T, F, String, Double, Short, Char>>() }
|
||||
|
||||
x = foobar<Int>()
|
||||
x = z.foobar<String>()
|
||||
x = <!ASSIGNMENT_TYPE_MISMATCH!>foobar<Int>()<!>
|
||||
x = <!ASSIGNMENT_TYPE_MISMATCH!>z.foobar<String>()<!>
|
||||
|
||||
var y = noParameters()
|
||||
y = noParameters()
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// FIR_IDENTICAL
|
||||
class C1<T1>
|
||||
|
||||
class C2<T3> {
|
||||
fun <T2> test() {
|
||||
class LocalClass
|
||||
C1<LocalClass>()
|
||||
}
|
||||
}
|
||||
|
||||
class A<T> {
|
||||
private inner class Inner
|
||||
private val test = ArrayList<Inner>()
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package
|
||||
|
||||
public final class A</*0*/ T> {
|
||||
public constructor A</*0*/ T>()
|
||||
private final val test: kotlin.collections.ArrayList<A<T>.Inner> /* = java.util.ArrayList<A<T>.Inner> */
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
private final inner class Inner /*captured type parameters: /*0*/ T*/ {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class C1</*0*/ T1> {
|
||||
public constructor C1</*0*/ T1>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class C2</*0*/ T3> {
|
||||
public constructor C2</*0*/ T3>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun </*0*/ T2> test(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user