FIR: Update test-data (Delegate inference)
This commit is contained in:
committed by
teamcity
parent
b45b624945
commit
40a2837b4c
+2
-2
@@ -42,7 +42,7 @@ FILE: delegateInference.kt
|
||||
|
||||
public final var x: R|kotlin/Boolean|by R|/FreezableVar.FreezableVar|<R|kotlin/Boolean|>(Boolean(true))
|
||||
public get(): R|kotlin/Boolean| {
|
||||
^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride</FreezableVar.getValue: R|kotlin/Boolean|>|(this@R|/Test|, ::R|/Test.x|)
|
||||
^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride</FreezableVar.getValue: R|Stub (builder inference): TypeVariable(_T)|>|(this@R|/Test|, ::R|/Test.x|)
|
||||
}
|
||||
public set(<set-?>: R|kotlin/Boolean|): R|kotlin/Unit| {
|
||||
this@R|/Test|.D|/Test.x|.R|SubstitutionOverride</FreezableVar.setValue: R|kotlin/Unit|>|(this@R|/Test|, ::R|/Test.x|, R|<local>/x|)
|
||||
@@ -50,7 +50,7 @@ FILE: delegateInference.kt
|
||||
|
||||
public final var y: R|kotlin/String|by R|/FreezableVar.FreezableVar|<R|kotlin/String|>(String())
|
||||
public get(): R|kotlin/String| {
|
||||
^ this@R|/Test|.D|/Test.y|.R|SubstitutionOverride</FreezableVar.getValue: R|kotlin/String|>|(this@R|/Test|, ::R|/Test.y|)
|
||||
^ this@R|/Test|.D|/Test.y|.R|SubstitutionOverride</FreezableVar.getValue: R|Stub (builder inference): TypeVariable(_T)|>|(this@R|/Test|, ::R|/Test.y|)
|
||||
}
|
||||
public set(<set-?>: R|kotlin/String|): R|kotlin/Unit| {
|
||||
this@R|/Test|.D|/Test.y|.R|SubstitutionOverride</FreezableVar.setValue: R|kotlin/Unit|>|(this@R|/Test|, ::R|/Test.y|, R|<local>/y|)
|
||||
|
||||
+11
-1
@@ -15,13 +15,23 @@ FILE: delegateWithArgInference.kt
|
||||
public final fun makeIntDelegate(t: R|kotlin/Int|): R|Delegate<kotlin/Int>| {
|
||||
^makeIntDelegate R|/Delegate.Delegate|<R|kotlin/Int|>(R|<local>/t|)
|
||||
}
|
||||
public final fun <TT> makeDelegate(t: R|TT|): R|Delegate<TT>| {
|
||||
^makeDelegate R|/Delegate.Delegate|<R|TT|>(R|<local>/t|)
|
||||
}
|
||||
public final fun <M> materialize(): R|M| {
|
||||
^materialize Null(null)!!
|
||||
}
|
||||
public final fun <M2> materialize2(): R|M2| {
|
||||
^materialize2 Null(null)!!
|
||||
}
|
||||
public final fun <Q> id(v: R|Q|): R|Q| {
|
||||
^id R|<local>/v|
|
||||
}
|
||||
public final val x: R|kotlin/Int|by R|/makeIntDelegate|(R|/id|<R|kotlin/Int|>(R|/materialize|<R|kotlin/Int|>()))
|
||||
public final val x: R|kotlin/Int|by R|/makeIntDelegate|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
lval x: R|kotlin/String| = R|/materialize|<R|kotlin/String|>()
|
||||
^ R|/materialize2|<R|kotlin/Int|>()
|
||||
}
|
||||
))
|
||||
public get(): R|kotlin/Int| {
|
||||
^ D|/x|.R|SubstitutionOverride</Delegate.getValue: R|kotlin/Int|>|(Null(null), ::R|/x|)
|
||||
}
|
||||
|
||||
+5
-3
@@ -18,18 +18,20 @@ FILE: delegateWithLambda.kt
|
||||
public final fun getAny(): R|kotlin/Any?| {
|
||||
^getAny Null(null)
|
||||
}
|
||||
public final fun <Q> materialize(): R|Q| {
|
||||
^materialize Null(null)!!
|
||||
}
|
||||
public final class Test : R|kotlin/Any| {
|
||||
public constructor(): R|Test| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val x: R|kotlin/String|by R|/lazy|<R|kotlin/String|>(<L> = lazy@fun <anonymous>(): R|kotlin/String| <inline=NoInline> {
|
||||
lval y: R|kotlin/String| = (R|/getAny|() as? R|kotlin/String|) ?: String()
|
||||
^ R|<local>/y|
|
||||
^ R|/materialize|<R|kotlin/String|>()
|
||||
}
|
||||
)
|
||||
public get(): R|kotlin/String| {
|
||||
^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride</LazyDelegate.getValue: R|kotlin/String|>|(this@R|/Test|, ::R|/Test.x|)
|
||||
^ this@R|/Test|.D|/Test.x|.R|SubstitutionOverride</LazyDelegate.getValue: R|Stub (builder inference): TypeVariable(_T)|>|(this@R|/Test|, ::R|/Test.x|)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-3
@@ -8,9 +8,10 @@ fun <T> lazy(block: () -> T): LazyDelegate<T> = LazyDelegate(block())
|
||||
|
||||
fun getAny(): Any? = null
|
||||
|
||||
fun <Q> materialize(): Q = null!!
|
||||
|
||||
class Test {
|
||||
val x by lazy {
|
||||
val y = getAny() as? String ?: ""
|
||||
y
|
||||
val x: String by lazy {
|
||||
materialize()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -38,9 +38,9 @@ FILE: provideDelegate.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val x: R|kotlin/Int|by R|/delegate|<R|kotlin/Int|>(Int(1)).R|SubstitutionOverride</DelegateProvider.provideDelegate: R|Delegate<kotlin/Int>|>|(this@R|/A|, ::R|/A.x|)
|
||||
public final val x: R|kotlin/Int|by R|/delegate|<R|kotlin/Int|>(Int(1)).R|SubstitutionOverride</DelegateProvider.provideDelegate: R|Delegate<Stub (builder inference): TypeVariable(_T)>|>|(this@R|/A|, ::R|/A.x|)
|
||||
public get(): R|kotlin/Int| {
|
||||
^ this@R|/A|.D|/A.x|.R|SubstitutionOverride</Delegate.getValue: R|kotlin/Int|>|(this@R|/A|, ::R|/A.x|)
|
||||
^ this@R|/A|.D|/A.x|.R|SubstitutionOverride</Delegate.getValue: R|Stub (builder inference): TypeVariable(_T)|>|(this@R|/A|, ::R|/A.x|)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -35,7 +35,7 @@ FILE: delegateTypeMismatch.kt
|
||||
|
||||
public final var classifierNamePolicy: R|ClassifierNamePolicy|by this@R|/A|.R|/A.property|<R|ClassifierNamePolicy|>(Q|ClassifierNamePolicy.SOURCE_CODE_QUALIFIED|)
|
||||
public get(): R|ClassifierNamePolicy| {
|
||||
^ this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|ClassifierNamePolicy|>|(this@R|/A|, ::R|/A.classifierNamePolicy|)
|
||||
^ this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|Stub (builder inference): TypeVariable(_T)|>|(this@R|/A|, ::R|/A.classifierNamePolicy|)
|
||||
}
|
||||
public set(<set-?>: R|ClassifierNamePolicy|): R|kotlin/Unit| {
|
||||
this@R|/A|.D|/A.classifierNamePolicy|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.setValue: R|kotlin/Unit|>|(this@R|/A|, ::R|/A.classifierNamePolicy|, R|<local>/classifierNamePolicy|)
|
||||
|
||||
Vendored
+13
-12
@@ -92,10 +92,10 @@ digraph delegateWithAnonymousObject_kt {
|
||||
35 -> {36};
|
||||
36 -> {37};
|
||||
|
||||
subgraph cluster_10 {
|
||||
subgraph cluster_13 {
|
||||
color=red
|
||||
38 [label="Enter function getValue" style="filled" fillcolor=red];
|
||||
subgraph cluster_11 {
|
||||
subgraph cluster_14 {
|
||||
color=blue
|
||||
39 [label="Enter block"];
|
||||
40 [label="Function call: R|/IssueListView.IssueListView|()"];
|
||||
@@ -113,10 +113,10 @@ digraph delegateWithAnonymousObject_kt {
|
||||
42 -> {43} [style=dotted];
|
||||
43 -> {44} [style=dotted];
|
||||
|
||||
subgraph cluster_12 {
|
||||
subgraph cluster_15 {
|
||||
color=red
|
||||
45 [label="Enter function setValue" style="filled" fillcolor=red];
|
||||
subgraph cluster_13 {
|
||||
subgraph cluster_16 {
|
||||
color=blue
|
||||
46 [label="Enter block"];
|
||||
47 [label="Function call: R|/IssueListView.IssueListView|()"];
|
||||
@@ -138,16 +138,16 @@ digraph delegateWithAnonymousObject_kt {
|
||||
51 -> {52} [style=dotted];
|
||||
52 -> {53} [style=dotted];
|
||||
|
||||
subgraph cluster_14 {
|
||||
subgraph cluster_17 {
|
||||
color=red
|
||||
54 [label="Enter function getter" style="filled" fillcolor=red];
|
||||
subgraph cluster_15 {
|
||||
subgraph cluster_18 {
|
||||
color=blue
|
||||
55 [label="Enter block"];
|
||||
56 [label="Access variable D|/IssuesListUserProfile.issueListView|"];
|
||||
57 [label="Access variable this@R|/IssuesListUserProfile|"];
|
||||
58 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|IssueListView|>|(...)"];
|
||||
59 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|IssueListView|>|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"];
|
||||
58 [label="Function call: this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|Stub (builder inference): TypeVariable(_Target)|>|(...)"];
|
||||
59 [label="Jump: ^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|Stub (builder inference): TypeVariable(_Target)|>|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)"];
|
||||
60 [label="Stub" style="filled" fillcolor=gray];
|
||||
61 [label="Exit block" style="filled" fillcolor=gray];
|
||||
}
|
||||
@@ -163,10 +163,10 @@ digraph delegateWithAnonymousObject_kt {
|
||||
60 -> {61} [style=dotted];
|
||||
61 -> {62} [style=dotted];
|
||||
|
||||
subgraph cluster_16 {
|
||||
subgraph cluster_19 {
|
||||
color=red
|
||||
63 [label="Enter function setter" style="filled" fillcolor=red];
|
||||
subgraph cluster_17 {
|
||||
subgraph cluster_20 {
|
||||
color=blue
|
||||
64 [label="Enter block"];
|
||||
65 [label="Access variable D|/IssuesListUserProfile.issueListView|"];
|
||||
@@ -185,7 +185,7 @@ digraph delegateWithAnonymousObject_kt {
|
||||
68 -> {69};
|
||||
69 -> {70};
|
||||
|
||||
subgraph cluster_18 {
|
||||
subgraph cluster_21 {
|
||||
color=red
|
||||
71 [label="Enter property" style="filled" fillcolor=red];
|
||||
72 [label="Postponed enter to lambda"];
|
||||
@@ -217,7 +217,8 @@ digraph delegateWithAnonymousObject_kt {
|
||||
80 [label="Exit property" style="filled" fillcolor=red];
|
||||
}
|
||||
70 -> {71};
|
||||
71 -> {72} [color=red];
|
||||
71 -> {72};
|
||||
71 -> {26} [style=dashed];
|
||||
71 -> {72};
|
||||
72 -> {73};
|
||||
72 -> {} [style=dashed];
|
||||
|
||||
compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.fir.txt
Vendored
+1
-1
@@ -41,7 +41,7 @@ FILE: delegateWithAnonymousObject.kt
|
||||
}
|
||||
)
|
||||
public get(): R|IssueListView| {
|
||||
^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|IssueListView|>|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)
|
||||
^ this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|Stub (builder inference): TypeVariable(_Target)|>|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|)
|
||||
}
|
||||
public set(<set-?>: R|IssueListView|): R|kotlin/Unit| {
|
||||
this@R|/IssuesListUserProfile|.D|/IssuesListUserProfile.issueListView|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.setValue: R|kotlin/Unit|>|(this@R|/IssuesListUserProfile|, ::R|/IssuesListUserProfile.issueListView|, R|<local>/issueListView|)
|
||||
|
||||
+2
-2
@@ -25,12 +25,12 @@ FILE: kt41917.kt
|
||||
|
||||
public final val implicit: R|kotlin/String|by R|/DummyDelegate.DummyDelegate|<R|kotlin/String|>(String(hello))
|
||||
public get(): R|kotlin/String| {
|
||||
^ this@R|/A|.D|/A.implicit|.R|SubstitutionOverride</DummyDelegate.getValue: R|kotlin/String|>|(this@R|/A|, ::R|/A.implicit|)
|
||||
^ this@R|/A|.D|/A.implicit|.R|SubstitutionOverride</DummyDelegate.getValue: R|Stub (builder inference): TypeVariable(_V)|>|(this@R|/A|, ::R|/A.implicit|)
|
||||
}
|
||||
|
||||
public final val explicit: R|kotlin/String|by R|/DummyDelegate.DummyDelegate|<R|kotlin/String|>(String(hello))
|
||||
public get(): R|kotlin/String| {
|
||||
^ this@R|/A|.D|/A.explicit|.R|SubstitutionOverride</DummyDelegate.getValue: R|kotlin/String|>|(this@R|/A|, ::R|/A.explicit|)
|
||||
^ this@R|/A|.D|/A.explicit|.R|SubstitutionOverride</DummyDelegate.getValue: R|Stub (builder inference): TypeVariable(_V)|>|(this@R|/A|, ::R|/A.explicit|)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -26,7 +26,7 @@ FILE: propertyWithFunctionalType.kt
|
||||
}
|
||||
)
|
||||
public get(): R|(B) -> B| {
|
||||
^ this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|(B) -> B|>|(this@R|/A|, ::R|/A.conventerWithExpectedType|)
|
||||
^ this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.getValue: R|Stub (builder inference): TypeVariable(_T)|>|(this@R|/A|, ::R|/A.conventerWithExpectedType|)
|
||||
}
|
||||
public set(<set-?>: R|(B) -> B|): R|kotlin/Unit| {
|
||||
this@R|/A|.D|/A.conventerWithExpectedType|.R|SubstitutionOverride<kotlin/properties/ReadWriteProperty.setValue: R|kotlin/Unit|>|(this@R|/A|, ::R|/A.conventerWithExpectedType|, R|<local>/conventerWithExpectedType|)
|
||||
|
||||
+3
-3
@@ -30,14 +30,14 @@ FILE: hideBySeverity.kt
|
||||
super<R|BaseState|>()
|
||||
}
|
||||
|
||||
public final val hideBySeverityDerived: R|kotlin/collections/MutableSet<kotlin/Int>|by this@R|/Some|.R|/BaseState.propertyDerived|<R|kotlin/collections/MutableSet<kotlin/Int>|>(R|kotlin/collections/mutableSetOf|<R|kotlin/Int|>()).R|SubstitutionOverride</StoredPropertyDerived.provideDelegate: R|StoredPropertyBase<kotlin/collections/MutableSet<kotlin/Int>>|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|)
|
||||
public final val hideBySeverityDerived: R|kotlin/collections/MutableSet<kotlin/Int>|by this@R|/Some|.R|/BaseState.propertyDerived|<R|kotlin/collections/MutableSet<kotlin/Int>|>(R|kotlin/collections/mutableSetOf|<R|kotlin/Int|>()).R|SubstitutionOverride</StoredPropertyDerived.provideDelegate: R|StoredPropertyBase<Stub (builder inference): TypeVariable(_PROPERTY_TYPE)>|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|)
|
||||
public get(): R|kotlin/collections/MutableSet<kotlin/Int>| {
|
||||
^ this@R|/Some|.D|/Some.hideBySeverityDerived|.R|SubstitutionOverride</StoredPropertyBase.getValue: R|kotlin/collections/MutableSet<kotlin/Int>|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|)
|
||||
^ this@R|/Some|.D|/Some.hideBySeverityDerived|.R|SubstitutionOverride</StoredPropertyBase.getValue: R|Stub (builder inference): TypeVariable(_PROPERTY_TYPE)|>|(this@R|/Some|, ::R|/Some.hideBySeverityDerived|)
|
||||
}
|
||||
|
||||
public final val hideBySeverityBase: R|kotlin/collections/MutableSet<kotlin/Int>|by this@R|/Some|.R|/BaseState.propertyBase|<R|kotlin/collections/MutableSet<kotlin/Int>|>(R|kotlin/collections/mutableSetOf|<R|kotlin/Int|>())
|
||||
public get(): R|kotlin/collections/MutableSet<kotlin/Int>| {
|
||||
^ this@R|/Some|.D|/Some.hideBySeverityBase|.R|SubstitutionOverride</StoredPropertyBase.getValue: R|kotlin/collections/MutableSet<kotlin/Int>|>|(this@R|/Some|, ::R|/Some.hideBySeverityBase|)
|
||||
^ this@R|/Some|.D|/Some.hideBySeverityBase|.R|SubstitutionOverride</StoredPropertyBase.getValue: R|Stub (builder inference): TypeVariable(_PROPERTY_TYPE)|>|(this@R|/Some|, ::R|/Some.hideBySeverityBase|)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -33,8 +33,8 @@ operator fun CustomDelegate3.setValue(thisRef: Any?, prop: KProperty<*>, value:
|
||||
|
||||
class Example {
|
||||
|
||||
var a by <!DELEGATE_SPECIAL_FUNCTION_MISSING, DELEGATE_SPECIAL_FUNCTION_MISSING, NEW_INFERENCE_ERROR!>CustomDelegate()<!>
|
||||
val aval by <!DELEGATE_SPECIAL_FUNCTION_MISSING, NEW_INFERENCE_ERROR!>CustomDelegate()<!>
|
||||
var a by <!DELEGATE_SPECIAL_FUNCTION_MISSING, DELEGATE_SPECIAL_FUNCTION_MISSING!>CustomDelegate()<!>
|
||||
val aval by <!DELEGATE_SPECIAL_FUNCTION_MISSING!>CustomDelegate()<!>
|
||||
var b by OkDelegate()
|
||||
var c by CustomDelegate2()
|
||||
var d by CustomDelegate3()
|
||||
|
||||
compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt
Vendored
+4
-4
@@ -9,10 +9,10 @@ class A(outer: Outer) {
|
||||
var g: String by outer.getContainer().getMyProperty()
|
||||
|
||||
|
||||
var b: String by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getMyProperty<!>())<!>
|
||||
var r: String by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(outer.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getContainer<!>().<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getMyProperty<!>())<!>
|
||||
var e: String by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>+<!> <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getMyProperty<!>())<!>
|
||||
var f: String by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getMyProperty<!>()) <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>-<!> 1<!>
|
||||
var b: String by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getMyProperty<!>())
|
||||
var r: String by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(outer.getContainer().<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getMyProperty<!>())
|
||||
var e: String by + <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(getMyProperty())
|
||||
var f: String by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>(getMyProperty()) - 1
|
||||
}
|
||||
|
||||
fun <A, B> foo(a: Any?) = MyProperty<A, B>()
|
||||
|
||||
+2
-2
@@ -4,10 +4,10 @@ package foo
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
open class A {
|
||||
val B.w: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>MyProperty()<!>
|
||||
val B.w: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>MyProperty<!>()<!>
|
||||
}
|
||||
|
||||
val B.r: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>MyProperty()<!>
|
||||
val B.r: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>MyProperty<!>()<!>
|
||||
|
||||
val A.e: Int by MyProperty()
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@ class A<R>() {
|
||||
operator fun <T> setValue(t: Any?, p: KProperty<*>, x: T) = Unit
|
||||
}
|
||||
|
||||
var a1: Int by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>A<!>()<!>
|
||||
var a1: Int by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>A<!>()
|
||||
var a2: Int by A<String>()
|
||||
|
||||
class B<R>() {
|
||||
@@ -24,4 +24,4 @@ class C<R>() {
|
||||
}
|
||||
|
||||
var c1: Int by C()
|
||||
var c2: Int by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>C<Number>()<!>
|
||||
var c2: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, TYPE_MISMATCH!>C<Number>()<!>
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
var a: Int by A()
|
||||
var a1 by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>A<!>()<!>
|
||||
var a1 by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>A()<!>
|
||||
|
||||
var b: Int by B()
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A {
|
||||
var a by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>MyProperty<!>()<!>
|
||||
var a by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>MyProperty<!>()
|
||||
}
|
||||
|
||||
class MyProperty<T, R> {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class B {
|
||||
val c by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Delegate(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>ag<!>)<!>
|
||||
val c by <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Delegate<!>(<!ARGUMENT_TYPE_MISMATCH, UNRESOLVED_REFERENCE!>ag<!>)
|
||||
}
|
||||
|
||||
class Delegate<T: Any>(val init: T) {
|
||||
|
||||
+1
-1
@@ -12,5 +12,5 @@ fun String.provideDelegate(a: Any?, p: KProperty<*>) = StringDelegate(this)
|
||||
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
|
||||
|
||||
val test1: String by "OK"
|
||||
val test2: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>"OK"<!>
|
||||
val test2: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, TYPE_MISMATCH!>"OK"<!>
|
||||
val test3 by "OK"
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ fun wrong(arg: Wrong) {}
|
||||
class Wrong
|
||||
|
||||
class Right {
|
||||
val prop: () -> Unit by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>::wrong<!>
|
||||
val prop: () -> Unit by <!DELEGATE_SPECIAL_FUNCTION_MISSING!>::wrong<!>
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ operator fun <T> String.provideDelegate(receiver: Any?, p: Any) = Delegate<T>()
|
||||
var test1: String by Delegate()
|
||||
var test2: String by Delegate<String>()
|
||||
|
||||
var test3: String by "OK"
|
||||
var test3: String by <!DELEGATE_SPECIAL_FUNCTION_MISSING, DELEGATE_SPECIAL_FUNCTION_MISSING!>"OK"<!>
|
||||
|
||||
var test4: String by "OK".provideDelegate(null, "")
|
||||
var test5: String by "OK".provideDelegate<String>(null, "")
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ operator fun String.provideDelegate(thisRef: Any?, prop: Any) = WrongDelegate(th
|
||||
|
||||
operator fun String.getValue(thisRef: Any?, prop: Any) = this
|
||||
|
||||
val test1: String by <!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>"OK"<!>
|
||||
val test1: String by <!TYPE_MISMATCH!>"OK"<!>
|
||||
val test2: Int by "OK"
|
||||
val test3 by "OK"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
val c: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>Delegate()<!>
|
||||
val c: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, TYPE_MISMATCH!>Delegate()<!>
|
||||
|
||||
class Delegate {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): String {
|
||||
|
||||
@@ -7,6 +7,6 @@ fun interface ReadOnlyProperty<in T, out V> {
|
||||
}
|
||||
|
||||
class Problem {
|
||||
val variable: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, NEW_INFERENCE_ERROR, NEW_INFERENCE_ERROR!>delegate()<!> // delegate returns `ReadOnlyProperty<Problem, {CharSequence & Int}>`
|
||||
val variable: Int by <!DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, NEW_INFERENCE_ERROR!>delegate()<!> // delegate returns `ReadOnlyProperty<Problem, {CharSequence & Int}>`
|
||||
fun <T : CharSequence> delegate() = null <!CAST_NEVER_SUCCEEDS!>as<!> ReadOnlyProperty<Problem, T>
|
||||
}
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
FILE fqName:<root> fileName:/kt47082.kt
|
||||
FUN name:produce visibility:public modality:FINAL <E> (block:@[ExtensionFunctionType] kotlin.Function1<<root>.Derived<E of <root>.produce>, kotlin.Unit>) returnType:E of <root>.produce
|
||||
TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?]
|
||||
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.Function1<<root>.Derived<E of <root>.produce>, kotlin.Unit>
|
||||
annotations:
|
||||
BuilderInference
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun produce <E> (block: @[ExtensionFunctionType] kotlin.Function1<<root>.Derived<E of <root>.produce>, kotlin.Unit>): E of <root>.produce declared in <root>'
|
||||
TYPE_OP type=E of <root>.produce origin=CAST typeOperand=E of <root>.produce
|
||||
CONST Null type=kotlin.Nothing? value=null
|
||||
CLASS INTERFACE name:Derived modality:ABSTRACT visibility:public superTypes:[<root>.Base<E of <root>.Derived>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Derived<E of <root>.Derived>
|
||||
TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?]
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.Base
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.Base
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String [fake_override] declared in <root>.Base
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Base<E of <root>.Base>
|
||||
TYPE_PARAMETER name:E index:0 variance:in superTypes:[kotlin.Any?]
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS INTERFACE name:Receiver modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Receiver<E of <root>.Receiver>
|
||||
TYPE_PARAMETER name:E index:0 variance:out superTypes:[kotlin.Any?]
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:toChannel visibility:public modality:FINAL <E, C> ($receiver:<root>.Receiver<E of <root>.toChannel>, destination:C of <root>.toChannel) returnType:C of <root>.toChannel
|
||||
TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?]
|
||||
TYPE_PARAMETER name:C index:1 variance: superTypes:[<root>.Base<E of <root>.toChannel>]
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Receiver<E of <root>.toChannel>
|
||||
VALUE_PARAMETER name:destination index:0 type:C of <root>.toChannel
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun toChannel <E, C> (destination: C of <root>.toChannel): C of <root>.toChannel declared in <root>'
|
||||
TYPE_OP type=C of <root>.toChannel origin=CAST typeOperand=C of <root>.toChannel
|
||||
CONST Null type=kotlin.Nothing? value=null
|
||||
FUN name:foo visibility:public modality:FINAL <R> (r:<root>.Receiver<R of <root>.foo>) returnType:R of <root>.foo
|
||||
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?]
|
||||
VALUE_PARAMETER name:r index:0 type:<root>.Receiver<R of <root>.foo>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun foo <R> (r: <root>.Receiver<R of <root>.foo>): R of <root>.foo declared in <root>'
|
||||
CALL 'public final fun produce <E> (block: @[ExtensionFunctionType] kotlin.Function1<<root>.Derived<E of <root>.produce>, kotlin.Unit>): E of <root>.produce declared in <root>' type=R of <root>.foo origin=null
|
||||
<E>: R of <root>.foo
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Derived<IrErrorType(null)>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Derived<IrErrorType(null)>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$produce type:<root>.Derived<IrErrorType(null)>
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun toChannel <E, C> (destination: C of <root>.toChannel): C of <root>.toChannel declared in <root>' type=<root>.Derived<IrErrorType(null)> origin=null
|
||||
<E>: R of <root>.foo
|
||||
<C>: <root>.Derived<IrErrorType(null)>
|
||||
$receiver: GET_VAR 'r: <root>.Receiver<R of <root>.foo> declared in <root>.foo' type=<root>.Receiver<R of <root>.foo> origin=null
|
||||
destination: GET_VAR '$this$produce: <root>.Derived<IrErrorType(null)> declared in <root>.foo.<anonymous>' type=<root>.Derived<IrErrorType(null)> origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="OK"
|
||||
@@ -1,31 +0,0 @@
|
||||
fun <E : Any?> produce(@BuilderInference block: @ExtensionFunctionType Function1<Derived<E>, Unit>): E {
|
||||
return null as E
|
||||
}
|
||||
|
||||
interface Derived<in E : Any?> : Base<E> {
|
||||
|
||||
}
|
||||
|
||||
interface Base<in E : Any?> {
|
||||
|
||||
}
|
||||
|
||||
interface Receiver<out E : Any?> {
|
||||
|
||||
}
|
||||
|
||||
fun <E : Any?, C : Base<E>> Receiver<E>.toChannel(destination: C): C {
|
||||
return null as C
|
||||
}
|
||||
|
||||
fun <R : Any?> foo(r: Receiver<R>): R {
|
||||
return produce<R>(block = local fun Derived<ErrorType>.<anonymous>() {
|
||||
r.toChannel<R, Derived<ErrorType>>(destination = $this$produce) /*~> Unit */
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_STDLIB
|
||||
// !OPT_IN: kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
Reference in New Issue
Block a user