Change Signature: Property support
#KT-6599 Fixed
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import java.lang.Override;
|
||||
|
||||
class J extends A {
|
||||
private int p;
|
||||
|
||||
@Override
|
||||
public int getP(String receiver) {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setP(String receiver, int value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
new A().getP("");
|
||||
new A().setP("", 1);
|
||||
|
||||
new B().getP("");
|
||||
new B().setP("", 2);
|
||||
|
||||
new J().getP("");
|
||||
new J().setP("", 3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
open class A {
|
||||
open var <caret>String.p: Int = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override var String.p: Int = 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = "".p
|
||||
"".p = 1
|
||||
}
|
||||
|
||||
with(B()) {
|
||||
val t = "".p
|
||||
"".p = 2
|
||||
}
|
||||
|
||||
with(J()) {
|
||||
val t = getP("")
|
||||
setP("", 3)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import java.lang.Override;
|
||||
|
||||
class J extends A {
|
||||
private int p;
|
||||
|
||||
@Override
|
||||
public int getP() {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setP(int value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
new A().getP();
|
||||
new A().setP(1);
|
||||
|
||||
new B().getP();
|
||||
new B().setP(2);
|
||||
|
||||
new J().getP();
|
||||
new J().setP(3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
open class A {
|
||||
open var <caret>p: Int = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override var p: Int = 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = p
|
||||
p = 1
|
||||
}
|
||||
|
||||
with(B()) {
|
||||
val t = p
|
||||
p = 2
|
||||
}
|
||||
|
||||
with(J()) {
|
||||
val t = getP()
|
||||
setP(3)
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
open class A {
|
||||
open var <caret>p: Int = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val t1 = A().p
|
||||
A().p = 1
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Explicit receiver is already present in call element: A().p
|
||||
Explicit receiver is already present in call element: A().p
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import test.TestPackage;
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
TestPackage.getP(A());
|
||||
TestPackage.setP(A(), 1);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
class A
|
||||
|
||||
open var <caret>A.p: Int
|
||||
get() = 1
|
||||
set(value: Int) {}
|
||||
|
||||
fun test() {
|
||||
val t = A().p
|
||||
A().p = 1
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import test.TestPackage;
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
TestPackage.getP();
|
||||
TestPackage.setP(1);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
class A
|
||||
|
||||
open var <caret>p: Int
|
||||
get() = 1
|
||||
set(value: Int) {}
|
||||
|
||||
fun test() {
|
||||
val t = p
|
||||
p = 1
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.Override;
|
||||
|
||||
class J extends A {
|
||||
private int p;
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getS() {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setS(@NotNull String value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
new A().getS();
|
||||
new A().setS(1);
|
||||
|
||||
new B().getS();
|
||||
new B().setS(2);
|
||||
|
||||
new J().getS();
|
||||
new J().setS(3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
open class A {
|
||||
open var <caret>s: String = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override var s: String = 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val t1 = A().s
|
||||
A().s = 1
|
||||
|
||||
val t2 = B().s
|
||||
B().s = 2
|
||||
|
||||
val t3 = J().getS()
|
||||
J().setS(3)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import java.lang.Override;
|
||||
|
||||
class J extends A {
|
||||
private int p;
|
||||
|
||||
@Override
|
||||
public int getP() {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setP(int value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
new A().getP();
|
||||
new A().setP(1);
|
||||
|
||||
new B().getP();
|
||||
new B().setP(2);
|
||||
|
||||
new J().getP();
|
||||
new J().setP(3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
open class A {
|
||||
open var <caret>p: Int = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override var p: Int = 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val t1 = A().p
|
||||
A().p = 1
|
||||
|
||||
val t2 = B().p
|
||||
B().p = 2
|
||||
|
||||
val t3 = J().getP()
|
||||
J().setP(3)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import java.lang.Override;
|
||||
|
||||
class J extends A {
|
||||
private int p;
|
||||
|
||||
@Override
|
||||
public int getP(int receiver) {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setP(int receiver, int value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
new A().getP("");
|
||||
new A().setP("", 1);
|
||||
|
||||
new B().getP("");
|
||||
new B().setP("", 2);
|
||||
|
||||
new J().getP("");
|
||||
new J().setP("", 3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
open class A {
|
||||
open var Int.<caret>p: Int = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override var Int.p: Int = 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = "".p
|
||||
"".p = 1
|
||||
}
|
||||
|
||||
with(B()) {
|
||||
val t = "".p
|
||||
"".p = 2
|
||||
}
|
||||
|
||||
with(J()) {
|
||||
val t = getP("")
|
||||
setP("", 3)
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import java.lang.Override;
|
||||
|
||||
class J extends A {
|
||||
private int p;
|
||||
|
||||
@Override
|
||||
public int getP(String receiver) {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setP(String receiver, int value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
new A().getP("");
|
||||
new A().setP("", 1);
|
||||
|
||||
new B().getP("");
|
||||
new B().setP("", 2);
|
||||
|
||||
new J().getP("");
|
||||
new J().setP("", 3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
open class A {
|
||||
open var String.<caret>p: Int = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override var String.p: Int = 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = "".p
|
||||
"".p = 1
|
||||
}
|
||||
|
||||
with(B()) {
|
||||
val t = "".p
|
||||
"".p = 2
|
||||
}
|
||||
|
||||
with(J()) {
|
||||
val t = getP("")
|
||||
setP("", 3)
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import test.TestPackage;
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
TestPackage.getP(new A());
|
||||
TestPackage.setP(new A(), 1);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test
|
||||
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
class A
|
||||
|
||||
open var String.<caret>p: Int
|
||||
get() = 1
|
||||
set(value: Int) {}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = p
|
||||
p = 1
|
||||
}
|
||||
|
||||
val t1 = A().p
|
||||
A().p = 1
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import test.TestPackage;
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
TestPackage.getP(new A());
|
||||
TestPackage.setP(new A(), 1);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test
|
||||
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
class A
|
||||
|
||||
open var A.<caret>p: Int
|
||||
get() = 1
|
||||
set(value: Int) {}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = p
|
||||
p = 1
|
||||
}
|
||||
|
||||
val t1 = A().p
|
||||
A().p = 1
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import java.lang.Override;
|
||||
|
||||
class J extends A {
|
||||
private int p;
|
||||
|
||||
@Override
|
||||
public int getP() {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setP(int value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
new A().getP();
|
||||
new A().setP(1);
|
||||
|
||||
new B().getP();
|
||||
new B().setP(2);
|
||||
|
||||
new J().getP();
|
||||
new J().setP(3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
open class A {
|
||||
open var <caret>p: Int = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override var p: Int = 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = p
|
||||
p = 1
|
||||
}
|
||||
|
||||
with(B()) {
|
||||
val t = p
|
||||
p = 2
|
||||
}
|
||||
|
||||
with(J()) {
|
||||
val t = getP()
|
||||
setP(3)
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import java.lang.Override;
|
||||
|
||||
class J extends A {
|
||||
private int p;
|
||||
|
||||
@Override
|
||||
public int getP(String receiver) {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setP(String receiver, int value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
new A().getP("");
|
||||
new A().setP("", 1);
|
||||
|
||||
new B().getP("");
|
||||
new B().setP("", 2);
|
||||
|
||||
new J().getP("");
|
||||
new J().setP("", 3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
open class A {
|
||||
open var String.<caret>p: Int = 1
|
||||
}
|
||||
|
||||
class B: A() {
|
||||
override var String.p: Int = 2
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = "".p
|
||||
"".p = 1
|
||||
}
|
||||
|
||||
with(B()) {
|
||||
val t = "".p
|
||||
"".p = 2
|
||||
}
|
||||
|
||||
with(J()) {
|
||||
val t = getP("")
|
||||
setP("", 3)
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import test.TestPackage;
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
TestPackage.getP();
|
||||
TestPackage.setP(1);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test
|
||||
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
class A
|
||||
|
||||
open var <caret>p: Int
|
||||
get() = 1
|
||||
set(value: Int) {}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = p
|
||||
p = 1
|
||||
}
|
||||
|
||||
val t1 = p
|
||||
p = 1
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import test.TestPackage;
|
||||
|
||||
class Test {
|
||||
static void test() {
|
||||
TestPackage.getP(new A());
|
||||
TestPackage.setP(new A(), 1);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test
|
||||
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
|
||||
|
||||
class A
|
||||
|
||||
open var A.<caret>p: Int
|
||||
get() = 1
|
||||
set(value: Int) {}
|
||||
|
||||
fun test() {
|
||||
with(A()) {
|
||||
val t = p
|
||||
p = 1
|
||||
}
|
||||
|
||||
val t1 = A().p
|
||||
A().p = 1
|
||||
}
|
||||
Reference in New Issue
Block a user