operator toDelegateFor: add front-end test for local delegate property

This commit is contained in:
Dmitry Petrov
2016-12-06 11:38:43 +03:00
committed by Stanislav Erokhin
parent 2ee31916c7
commit a6bc7271ae
3 changed files with 22 additions and 0 deletions
@@ -0,0 +1,11 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
operator fun String.toDelegateFor(a: Any?, p: KProperty<*>) = this
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
fun test(): String {
val result by "OK"
return result
}
@@ -0,0 +1,5 @@
package
public fun test(): kotlin.String
public operator fun kotlin.String.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String
public operator fun kotlin.String.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String
@@ -5847,6 +5847,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("localDelegatedProperty.kt")
public void testLocalDelegatedProperty() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/localDelegatedProperty.kt");
doTest(fileName);
}
@TestMetadata("noOperatorModifierOnToDelegateFor.kt")
public void testNoOperatorModifierOnToDelegateFor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/noOperatorModifierOnToDelegateFor.kt");