From 7d278f2f42653cd4d78ce06867642283875ece3e Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 18 Mar 2015 00:19:41 +0300 Subject: [PATCH] Use class name as secondary constructor name --- .../org/jetbrains/kotlin/psi/JetSecondaryConstructor.java | 4 ++-- .../cfg/secondaryConstructors/withPrimary.instructions | 4 ++-- .../testData/cfg/secondaryConstructors/withPrimary.values | 4 ++-- .../secondaryConstructors/withPrimarySuper.instructions | 4 ++-- .../cfg/secondaryConstructors/withPrimarySuper.values | 4 ++-- .../cfg/secondaryConstructors/withReturn.instructions | 2 +- .../testData/cfg/secondaryConstructors/withReturn.values | 2 +- .../cfg/secondaryConstructors/withoutPrimary.instructions | 8 ++++---- .../cfg/secondaryConstructors/withoutPrimary.values | 8 ++++---- .../withoutPrimarySuper.instructions | 8 ++++---- .../cfg/secondaryConstructors/withoutPrimarySuper.values | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetSecondaryConstructor.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetSecondaryConstructor.java index df720c4ddff..5a17d39bd56 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetSecondaryConstructor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetSecondaryConstructor.java @@ -116,7 +116,7 @@ public class JetSecondaryConstructor extends JetDeclarationStub"; + return getClassOrObject().getName(); } @Nullable @@ -146,7 +146,7 @@ public class JetSecondaryConstructor extends JetDeclarationStub PREV:[, ] ===================== -== == +== A == constructor(): this('a') { y = 2 } @@ -78,7 +78,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(a: Int, b: Int = 3): this(b.toChar()) { y = x } diff --git a/compiler/testData/cfg/secondaryConstructors/withPrimary.values b/compiler/testData/cfg/secondaryConstructors/withPrimary.values index d896a9b3fe8..0fe11b3c296 100644 --- a/compiler/testData/cfg/secondaryConstructors/withPrimary.values +++ b/compiler/testData/cfg/secondaryConstructors/withPrimary.values @@ -40,7 +40,7 @@ z = 8 !: * y = 9 !: * { y = 9 } !: * COPY ===================== -== == +== A == constructor(): this('a') { y = 2 } @@ -52,7 +52,7 @@ this('a') : * NEW: call(this('a'), |) -> y = 2 !: * { y = 2 } !: * COPY ===================== -== == +== A == constructor(a: Int, b: Int = 3): this(b.toChar()) { y = x } diff --git a/compiler/testData/cfg/secondaryConstructors/withPrimarySuper.instructions b/compiler/testData/cfg/secondaryConstructors/withPrimarySuper.instructions index 259cc99fbe1..d19eb0427e2 100644 --- a/compiler/testData/cfg/secondaryConstructors/withPrimarySuper.instructions +++ b/compiler/testData/cfg/secondaryConstructors/withPrimarySuper.instructions @@ -88,7 +88,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(): this('a') { y = 2 } @@ -109,7 +109,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(a: Int, b: Int = 3): this(b.toChar()) { y = x } diff --git a/compiler/testData/cfg/secondaryConstructors/withPrimarySuper.values b/compiler/testData/cfg/secondaryConstructors/withPrimarySuper.values index b85d7106f53..77961873b77 100644 --- a/compiler/testData/cfg/secondaryConstructors/withPrimarySuper.values +++ b/compiler/testData/cfg/secondaryConstructors/withPrimarySuper.values @@ -54,7 +54,7 @@ z = 8 !: * y = 9 !: * { y = 9 } !: * COPY ===================== -== == +== A == constructor(): this('a') { y = 2 } @@ -66,7 +66,7 @@ this('a') : * NEW: call(this('a'), |) -> y = 2 !: * { y = 2 } !: * COPY ===================== -== == +== A == constructor(a: Int, b: Int = 3): this(b.toChar()) { y = x } diff --git a/compiler/testData/cfg/secondaryConstructors/withReturn.instructions b/compiler/testData/cfg/secondaryConstructors/withReturn.instructions index 9c75852c260..e90645b2181 100644 --- a/compiler/testData/cfg/secondaryConstructors/withReturn.instructions +++ b/compiler/testData/cfg/secondaryConstructors/withReturn.instructions @@ -19,7 +19,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor() { if (1 == 1) { return diff --git a/compiler/testData/cfg/secondaryConstructors/withReturn.values b/compiler/testData/cfg/secondaryConstructors/withReturn.values index 8cfaa16d773..5415ec09de6 100644 --- a/compiler/testData/cfg/secondaryConstructors/withReturn.values +++ b/compiler/testData/cfg/secondaryConstructors/withReturn.values @@ -11,7 +11,7 @@ class A { } --------------------- ===================== -== == +== A == constructor() { if (1 == 1) { return diff --git a/compiler/testData/cfg/secondaryConstructors/withoutPrimary.instructions b/compiler/testData/cfg/secondaryConstructors/withoutPrimary.instructions index 9de2f406acf..34952b735e5 100644 --- a/compiler/testData/cfg/secondaryConstructors/withoutPrimary.instructions +++ b/compiler/testData/cfg/secondaryConstructors/withoutPrimary.instructions @@ -41,7 +41,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor() { x = 1 y = 2 @@ -81,7 +81,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(a: Int, b: Int = 3) { x = a y = x @@ -132,7 +132,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(a: String, b: Int = 4): this() { y = 5 } @@ -162,7 +162,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(a: Double, b: Int = 6): this(a.toInt()) { y = 7 } diff --git a/compiler/testData/cfg/secondaryConstructors/withoutPrimary.values b/compiler/testData/cfg/secondaryConstructors/withoutPrimary.values index 64d62056c11..c91b8d7c546 100644 --- a/compiler/testData/cfg/secondaryConstructors/withoutPrimary.values +++ b/compiler/testData/cfg/secondaryConstructors/withoutPrimary.values @@ -33,7 +33,7 @@ class A { } --------------------- ===================== -== == +== A == constructor() { x = 1 y = 2 @@ -49,7 +49,7 @@ constructor() { y = 2 !: * { x = 1 y = 2 } !: * COPY ===================== -== == +== A == constructor(a: Int, b: Int = 3) { x = a y = x @@ -70,7 +70,7 @@ x : Int NEW: r(x|) -> y = x !: * { x = a y = x } !: * COPY ===================== -== == +== A == constructor(a: String, b: Int = 4): this() { y = 5 } @@ -85,7 +85,7 @@ this() : * NEW: call(this(), ) -> y = 5 !: * { y = 5 } !: * COPY ===================== -== == +== A == constructor(a: Double, b: Int = 6): this(a.toInt()) { y = 7 } diff --git a/compiler/testData/cfg/secondaryConstructors/withoutPrimarySuper.instructions b/compiler/testData/cfg/secondaryConstructors/withoutPrimarySuper.instructions index 6ea73f7a14f..33d6296949c 100644 --- a/compiler/testData/cfg/secondaryConstructors/withoutPrimarySuper.instructions +++ b/compiler/testData/cfg/secondaryConstructors/withoutPrimarySuper.instructions @@ -56,7 +56,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(): super(11) { x = 1 y = 2 @@ -97,7 +97,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(a: Int, b: Int = 3): super(b) { x = a y = x @@ -149,7 +149,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(a: String, b: Int = 4): this() { y = 5 } @@ -179,7 +179,7 @@ error: sink: PREV:[, ] ===================== -== == +== A == constructor(a: Double, b: Int = 6): this(a.toInt()) { y = 7 } diff --git a/compiler/testData/cfg/secondaryConstructors/withoutPrimarySuper.values b/compiler/testData/cfg/secondaryConstructors/withoutPrimarySuper.values index 9b6c848d075..3572857438d 100644 --- a/compiler/testData/cfg/secondaryConstructors/withoutPrimarySuper.values +++ b/compiler/testData/cfg/secondaryConstructors/withoutPrimarySuper.values @@ -38,7 +38,7 @@ class A : B { } --------------------- ===================== -== == +== A == constructor(): super(11) { x = 1 y = 2 @@ -55,7 +55,7 @@ super(11) : * NEW: call(super(11), |) -> y = 2 !: * { x = 1 y = 2 } !: * COPY ===================== -== == +== A == constructor(a: Int, b: Int = 3): super(b) { x = a y = x @@ -77,7 +77,7 @@ x : Int NEW: r(x|) -> y = x !: * { x = a y = x } !: * COPY ===================== -== == +== A == constructor(a: String, b: Int = 4): this() { y = 5 } @@ -92,7 +92,7 @@ this() : * NEW: call(this(), ) -> y = 5 !: * { y = 5 } !: * COPY ===================== -== == +== A == constructor(a: Double, b: Int = 6): this(a.toInt()) { y = 7 }