FIR: Fix SAM conversion for constructor calls
This commit is contained in:
+1
-1
@@ -18,6 +18,6 @@ public class Observable<T> {
|
||||
|
||||
import j.*
|
||||
|
||||
class K : <!INAPPLICABLE_CANDIDATE!>Observable<String><!>({})
|
||||
class K : Observable<String>({})
|
||||
|
||||
class J : Observable<String>(null)
|
||||
|
||||
@@ -14,5 +14,5 @@ public class Observable<T> {
|
||||
typealias ObservableAlias<T> = Observable<T>
|
||||
typealias ObservableIntAlias = Observable<Int>
|
||||
|
||||
class A : <!INAPPLICABLE_CANDIDATE!>ObservableAlias<String><!>({})
|
||||
class B : <!INAPPLICABLE_CANDIDATE!>ObservableIntAlias<!>({})
|
||||
class A : ObservableAlias<String>({})
|
||||
class B : ObservableIntAlias({})
|
||||
|
||||
+1
-1
@@ -13,5 +13,5 @@ public class J {
|
||||
package test
|
||||
|
||||
fun test() {
|
||||
<!INAPPLICABLE_CANDIDATE!>J<!>("", r = { }, z = false)
|
||||
J("", r = { }, z = false)
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@ public class A<E> {
|
||||
// FILE: main.kt
|
||||
|
||||
fun foo() {
|
||||
val result: A<String> = <!INAPPLICABLE_CANDIDATE!>A<!><String> { x, y -> 1 }
|
||||
val result: A<String> = A<String> { x, y -> 1 }
|
||||
}
|
||||
|
||||
+2
-2
@@ -36,10 +36,10 @@ fun main(x2: Runnable) {
|
||||
Test.foo1(x2, *arrayOf(""))
|
||||
|
||||
val i1 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, arrayOf())
|
||||
val i2 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, *arrayOf())
|
||||
val i2 = Test({}, *arrayOf())
|
||||
val i3 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, x3)
|
||||
val i4 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, arrayOf(""))
|
||||
val i5 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, {}, *arrayOf(""))
|
||||
val i5 = Test({}, {}, *arrayOf(""))
|
||||
val i6 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, {}, arrayOf())
|
||||
|
||||
i1.<!UNRESOLVED_REFERENCE!>foo2<!>({}, {}, arrayOf())
|
||||
|
||||
Vendored
+11
-11
@@ -36,19 +36,19 @@ fun main(x2: Runnable) {
|
||||
Test.foo1(x2, *arrayOf(""))
|
||||
|
||||
val i1 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, arrayOf())
|
||||
val i2 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, *arrayOf())
|
||||
val i2 = Test({}, *arrayOf())
|
||||
val i3 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, x3)
|
||||
val i4 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, arrayOf(""))
|
||||
val i5 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, {}, *arrayOf(""))
|
||||
val i5 = Test({}, {}, *arrayOf(""))
|
||||
val i6 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, {}, arrayOf())
|
||||
|
||||
i2.<!UNRESOLVED_REFERENCE!>foo2<!>({}, {}, arrayOf())
|
||||
i2.<!UNRESOLVED_REFERENCE!>foo2<!>({}, {}, *arrayOf())
|
||||
i2.<!UNRESOLVED_REFERENCE!>foo2<!>({}, x2, arrayOf())
|
||||
i2.<!UNRESOLVED_REFERENCE!>foo2<!>(x2, {}, *arrayOf())
|
||||
i2.<!INAPPLICABLE_CANDIDATE!>foo2<!>({}, {}, arrayOf())
|
||||
i2.foo2({}, {}, *arrayOf())
|
||||
i2.<!INAPPLICABLE_CANDIDATE!>foo2<!>({}, x2, arrayOf())
|
||||
i2.foo2(x2, {}, *arrayOf())
|
||||
|
||||
i2.<!UNRESOLVED_REFERENCE!>foo2<!>({}, {}, arrayOf(""))
|
||||
i2.<!UNRESOLVED_REFERENCE!>foo2<!>({}, {}, *x3)
|
||||
i2.<!UNRESOLVED_REFERENCE!>foo2<!>({}, x2, x3)
|
||||
i2.<!UNRESOLVED_REFERENCE!>foo2<!>(x2, {}, *arrayOf(""))
|
||||
}
|
||||
i2.<!INAPPLICABLE_CANDIDATE!>foo2<!>({}, {}, arrayOf(""))
|
||||
i2.foo2({}, {}, *x3)
|
||||
i2.<!INAPPLICABLE_CANDIDATE!>foo2<!>({}, x2, x3)
|
||||
i2.foo2(x2, {}, *arrayOf(""))
|
||||
}
|
||||
|
||||
+3
-3
@@ -36,10 +36,10 @@ fun main(x2: Runnable) {
|
||||
Test.foo1(x2, *arrayOf(""))
|
||||
|
||||
val i1 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, arrayOf())
|
||||
val i2 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, *arrayOf())
|
||||
val i2 = Test({}, *arrayOf())
|
||||
val i3 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, x3)
|
||||
val i4 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, arrayOf(""))
|
||||
val i5 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, {}, *arrayOf(""))
|
||||
val i5 = Test({}, {}, *arrayOf(""))
|
||||
val i6 = <!INAPPLICABLE_CANDIDATE!>Test<!>({}, {}, arrayOf())
|
||||
|
||||
i1.<!UNRESOLVED_REFERENCE!>foo2<!>({}, {}, arrayOf())
|
||||
@@ -51,4 +51,4 @@ fun main(x2: Runnable) {
|
||||
i1.<!UNRESOLVED_REFERENCE!>foo2<!>({}, {}, *x3)
|
||||
i1.<!UNRESOLVED_REFERENCE!>foo2<!>({}, x2, x3)
|
||||
i1.<!UNRESOLVED_REFERENCE!>foo2<!>(x2, {}, *arrayOf(""))
|
||||
}
|
||||
}
|
||||
|
||||
+9
-6
@@ -1,14 +1,17 @@
|
||||
FILE fqName:<root> fileName:/samConversionInGenericConstructorCall.kt
|
||||
FUN name:test1 visibility:public modality:FINAL <> (f:kotlin.Function1<kotlin.String, kotlin.String>) returnType:IrErrorType
|
||||
FUN name:test1 visibility:public modality:FINAL <> (f:kotlin.Function1<kotlin.String, kotlin.String>) returnType:<root>.C<kotlin.String?>
|
||||
VALUE_PARAMETER name:f index:0 type:kotlin.Function1<kotlin.String, kotlin.String>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test1 (f: kotlin.Function1<kotlin.String, kotlin.String>): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/C.C]>#' type=IrErrorType
|
||||
GET_VAR 'f: kotlin.Function1<kotlin.String, kotlin.String> declared in <root>.test1' type=kotlin.Function1<kotlin.String, kotlin.String> origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun test1 (f: kotlin.Function1<kotlin.String, kotlin.String>): <root>.C<kotlin.String?> declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (jxx: <root>.J<X of <uninitialized parent>?, X of <uninitialized parent>?>?) declared in <root>.C' type=<root>.C<kotlin.String?> origin=null
|
||||
<class: X>: kotlin.String?
|
||||
jxx: GET_VAR 'f: kotlin.Function1<kotlin.String, kotlin.String> declared in <root>.test1' type=kotlin.Function1<kotlin.String, kotlin.String> origin=null
|
||||
FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Function1<kotlin.String, kotlin.String> origin=CAST typeOperand=kotlin.Function1<kotlin.String, kotlin.String>
|
||||
GET_VAR 'x: kotlin.Any declared in <root>.test2' type=kotlin.Any origin=null
|
||||
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/C.C]>#' type=IrErrorType
|
||||
GET_VAR 'x: kotlin.Any declared in <root>.test2' type=kotlin.Function1<kotlin.String, kotlin.String> origin=null
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (jxx: <root>.J<X of <uninitialized parent>?, X of <uninitialized parent>?>?) declared in <root>.C' type=<root>.C<kotlin.String?> origin=null
|
||||
<class: X>: kotlin.String?
|
||||
jxx: TYPE_OP type=kotlin.Function1<kotlin.String, kotlin.String> origin=IMPLICIT_CAST typeOperand=kotlin.Function1<kotlin.String, kotlin.String>
|
||||
GET_VAR 'x: kotlin.Any declared in <root>.test2' type=kotlin.Any origin=null
|
||||
|
||||
Vendored
+6
-8
@@ -4,7 +4,7 @@ FILE fqName:<root> fileName:/samConversionInGenericConstructorCall_NI.kt
|
||||
VALUE_PARAMETER name:f2 index:1 type:kotlin.Function1<kotlin.Int, kotlin.String>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test3 (f1: kotlin.Function1<kotlin.String, kotlin.String>, f2: kotlin.Function1<kotlin.Int, kotlin.String>): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: D>#' type=IrErrorType
|
||||
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/C.D.D]>#' type=IrErrorType
|
||||
GET_VAR 'f2: kotlin.Function1<kotlin.Int, kotlin.String> declared in <root>.test3' type=kotlin.Function1<kotlin.Int, kotlin.String> origin=null
|
||||
CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Outer<T1 of <root>.Outer>
|
||||
@@ -75,18 +75,16 @@ FILE fqName:<root> fileName:/samConversionInGenericConstructorCall_NI.kt
|
||||
VALUE_PARAMETER name:g index:1 type:kotlin.Function1<kotlin.Any, kotlin.String>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test4 (f: kotlin.Function1<kotlin.String, kotlin.String>, g: kotlin.Function1<kotlin.Any, kotlin.String>): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Unresolved name: Inner>#' type=IrErrorType
|
||||
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/Outer.Inner.Inner]>#' type=IrErrorType
|
||||
GET_VAR 'g: kotlin.Function1<kotlin.Any, kotlin.String> declared in <root>.test4' type=kotlin.Function1<kotlin.Any, kotlin.String> origin=null
|
||||
FUN name:testGenericJavaCtor1 visibility:public modality:FINAL <> (f:kotlin.Function1<kotlin.String, kotlin.Int>) returnType:IrErrorType
|
||||
FUN name:testGenericJavaCtor1 visibility:public modality:FINAL <> (f:kotlin.Function1<kotlin.String, kotlin.Int>) returnType:<root>.G<kotlin.String?>
|
||||
VALUE_PARAMETER name:f index:0 type:kotlin.Function1<kotlin.String, kotlin.Int>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun testGenericJavaCtor1 (f: kotlin.Function1<kotlin.String, kotlin.Int>): IrErrorType declared in <root>'
|
||||
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/G.G]>#' type=IrErrorType
|
||||
GET_VAR 'f: kotlin.Function1<kotlin.String, kotlin.Int> declared in <root>.testGenericJavaCtor1' type=kotlin.Function1<kotlin.String, kotlin.Int> origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun testGenericJavaCtor1 (f: kotlin.Function1<kotlin.String, kotlin.Int>): <root>.G<kotlin.String?> declared in <root>'
|
||||
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.G<kotlin.String?>
|
||||
FUN name:testGenericJavaCtor2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Function1<kotlin.String, kotlin.Int> origin=CAST typeOperand=kotlin.Function1<kotlin.String, kotlin.Int>
|
||||
GET_VAR 'x: kotlin.Any declared in <root>.testGenericJavaCtor2' type=kotlin.Any origin=null
|
||||
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): [/G.G]>#' type=IrErrorType
|
||||
GET_VAR 'x: kotlin.Any declared in <root>.testGenericJavaCtor2' type=kotlin.Function1<kotlin.String, kotlin.Int> origin=null
|
||||
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.G<kotlin.String?>
|
||||
|
||||
Reference in New Issue
Block a user