Skip to content

Commit 63e4a10

Browse files
committed
Paint without parentheses testcase
1 parent fd0f621 commit 63e4a10

9 files changed

Lines changed: 106 additions & 92 deletions

File tree

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/build.gradle.kts.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ kobby {
2121
kotlin {
2222
entity {
2323
projection {
24-
// todo enableNotationWithoutParentheses = true
24+
enableNotationWithoutParentheses = true
2525
}
2626
}
2727
}

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/expected/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/kobby/kotlin/entity/Circle.kt.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotl
1717

1818
import io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotlin.PaintContext
1919
import io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotlin.PaintDSL
20+
import kotlin.Any
2021
import kotlin.Boolean
2122
import kotlin.Int
2223
import kotlin.Long
@@ -36,11 +37,11 @@ public interface Circle : Shape {
3637

3738
@PaintDSL
3839
public interface CircleProjection : ShapeProjection {
39-
override fun id()
40+
override val id: Any?
4041

41-
override fun opaque()
42+
override val opaque: Any?
4243

43-
public fun radius()
44+
public val radius: Any?
4445

4546
override fun __minimize() {
4647
}

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/expected/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/kobby/kotlin/entity/Rectangle.kt.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotl
1717

1818
import io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotlin.PaintContext
1919
import io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotlin.PaintDSL
20+
import kotlin.Any
2021
import kotlin.Boolean
2122
import kotlin.Int
2223
import kotlin.Long
@@ -41,15 +42,15 @@ public interface Rectangle : Shape, Polygon {
4142

4243
@PaintDSL
4344
public interface RectangleProjection : ShapeProjection, PolygonProjection {
44-
override fun id()
45+
override val id: Any?
4546

46-
override fun opaque()
47+
override val opaque: Any?
4748

48-
public fun width()
49+
public val width: Any?
4950

50-
public fun height()
51+
public val height: Any?
5152

52-
public fun tempIds()
53+
public val tempIds: Any?
5354

5455
override fun __minimize() {
5556
}

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/expected/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/kobby/kotlin/entity/Shape.kt.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotl
1717

1818
import io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotlin.PaintContext
1919
import io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotlin.PaintDSL
20+
import kotlin.Any
2021
import kotlin.Boolean
2122
import kotlin.Long
2223
import kotlin.Suppress
@@ -32,9 +33,9 @@ public interface Shape {
3233

3334
@PaintDSL
3435
public interface ShapeProjection {
35-
public fun id()
36+
public val id: Any?
3637

37-
public fun opaque()
38+
public val opaque: Any?
3839

3940
public fun __minimize() {
4041
}

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/expected/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/kobby/kotlin/entity/Square.kt.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotl
1717

1818
import io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotlin.PaintContext
1919
import io.github.ermadmi78.kobby.testcases.paint_without_parentheses.kobby.kotlin.PaintDSL
20+
import kotlin.Any
2021
import kotlin.Boolean
2122
import kotlin.Int
2223
import kotlin.Long
@@ -36,11 +37,11 @@ public interface Square : Shape, Polygon {
3637

3738
@PaintDSL
3839
public interface SquareProjection : ShapeProjection, PolygonProjection {
39-
override fun id()
40+
override val id: Any?
4041

41-
override fun opaque()
42+
override val opaque: Any?
4243

43-
public fun length()
44+
public val length: Any?
4445

4546
override fun __minimize() {
4647
}

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/expected/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/kobby/kotlin/entity/impl/CircleImpl.kt.txt

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,32 +101,38 @@ internal class CircleImpl(
101101
internal open class CircleProjectionImpl : CircleProjection {
102102
internal var __innerId0: Boolean = false
103103

104-
internal var __innerOpaque1: Boolean = false
104+
override val id: Any?
105+
get() {
106+
__innerId0 = true
107+
return null
108+
}
105109

106-
internal var __innerRadius2: Boolean = false
110+
internal var __innerOpaque1: Boolean = false
107111

108-
override fun id() {
109-
__innerId0 = true
110-
}
112+
override val opaque: Any?
113+
get() {
114+
__innerOpaque1 = true
115+
return null
116+
}
111117

112-
override fun opaque() {
113-
__innerOpaque1 = true
114-
}
118+
internal var __innerRadius2: Boolean = false
115119

116-
override fun radius() {
117-
__innerRadius2 = true
118-
}
120+
override val radius: Any?
121+
get() {
122+
__innerRadius2 = true
123+
return null
124+
}
119125

120126
@Suppress("UNUSED_PARAMETER", "UNUSED_CHANGED_VALUE", "KotlinConstantConditions")
121127
internal fun ___innerRepeatProjection(ignore: Set<String>, __projection: CircleProjection) {
122128
if ("id" !in ignore && __innerId0) {
123-
__projection.id()
129+
__projection.id
124130
}
125131
if ("opaque" !in ignore && __innerOpaque1) {
126-
__projection.opaque()
132+
__projection.opaque
127133
}
128134
if ("radius" !in ignore && __innerRadius2) {
129-
__projection.radius()
135+
__projection.radius
130136
}
131137
}
132138

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/expected/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/kobby/kotlin/entity/impl/RectangleImpl.kt.txt

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -132,50 +132,60 @@ internal class RectangleImpl(
132132
internal open class RectangleProjectionImpl : RectangleProjection {
133133
internal var __innerId0: Boolean = false
134134

135-
internal var __innerOpaque1: Boolean = false
135+
override val id: Any?
136+
get() {
137+
__innerId0 = true
138+
return null
139+
}
136140

137-
internal var __innerWidth2: Boolean = false
141+
internal var __innerOpaque1: Boolean = false
138142

139-
internal var __innerHeight3: Boolean = false
143+
override val opaque: Any?
144+
get() {
145+
__innerOpaque1 = true
146+
return null
147+
}
140148

141-
internal var __innerTempIds4: Boolean = false
149+
internal var __innerWidth2: Boolean = false
142150

143-
override fun id() {
144-
__innerId0 = true
145-
}
151+
override val width: Any?
152+
get() {
153+
__innerWidth2 = true
154+
return null
155+
}
146156

147-
override fun opaque() {
148-
__innerOpaque1 = true
149-
}
157+
internal var __innerHeight3: Boolean = false
150158

151-
override fun width() {
152-
__innerWidth2 = true
153-
}
159+
override val height: Any?
160+
get() {
161+
__innerHeight3 = true
162+
return null
163+
}
154164

155-
override fun height() {
156-
__innerHeight3 = true
157-
}
165+
internal var __innerTempIds4: Boolean = false
158166

159-
override fun tempIds() {
160-
__innerTempIds4 = true
161-
}
167+
override val tempIds: Any?
168+
get() {
169+
__innerTempIds4 = true
170+
return null
171+
}
162172

163173
@Suppress("UNUSED_PARAMETER", "UNUSED_CHANGED_VALUE", "KotlinConstantConditions")
164174
internal fun ___innerRepeatProjection(ignore: Set<String>, __projection: RectangleProjection) {
165175
if ("id" !in ignore && __innerId0) {
166-
__projection.id()
176+
__projection.id
167177
}
168178
if ("opaque" !in ignore && __innerOpaque1) {
169-
__projection.opaque()
179+
__projection.opaque
170180
}
171181
if ("width" !in ignore && __innerWidth2) {
172-
__projection.width()
182+
__projection.width
173183
}
174184
if ("height" !in ignore && __innerHeight3) {
175-
__projection.height()
185+
__projection.height
176186
}
177187
if ("tempIds" !in ignore && __innerTempIds4) {
178-
__projection.tempIds()
188+
__projection.tempIds
179189
}
180190
}
181191

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/expected/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/kobby/kotlin/entity/impl/ShapeImpl.kt.txt

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,26 @@ internal open class ShapeQualifiedProjectionImpl : ShapeQualifiedProjection {
4444

4545
internal var __innerId0: Boolean = false
4646

47+
override val id: Any?
48+
get() {
49+
__innerId0 = true
50+
return null
51+
}
52+
4753
internal var __innerOpaque1: Boolean = false
4854

55+
override val opaque: Any?
56+
get() {
57+
__innerOpaque1 = true
58+
return null
59+
}
60+
4961
internal val ___inner__onCircle: CircleProjectionImpl = CircleProjectionImpl()
5062

5163
internal val ___inner__onSquare: SquareProjectionImpl = SquareProjectionImpl()
5264

5365
internal val ___inner__onRectangle: RectangleProjectionImpl = RectangleProjectionImpl()
5466

55-
override fun id() {
56-
__innerId0 = true
57-
58-
___inner__onCircle.__innerId0 = __innerId0
59-
60-
___inner__onSquare.__innerId0 = __innerId0
61-
62-
___inner__onRectangle.__innerId0 = __innerId0
63-
64-
___innerIgnore += "id"
65-
}
66-
67-
override fun opaque() {
68-
__innerOpaque1 = true
69-
70-
___inner__onCircle.__innerOpaque1 = __innerOpaque1
71-
72-
___inner__onSquare.__innerOpaque1 = __innerOpaque1
73-
74-
___inner__onRectangle.__innerOpaque1 = __innerOpaque1
75-
76-
___innerIgnore += "opaque"
77-
}
78-
7967
override fun __onCircle(__projection: CircleProjection.() -> Unit) {
8068
CircleProjectionImpl().apply(__projection).___innerRepeatProjection(___innerIgnore, ___inner__onCircle)
8169
}
@@ -92,10 +80,10 @@ internal open class ShapeQualifiedProjectionImpl : ShapeQualifiedProjection {
9280
internal fun ___innerRepeatProjection(ignore: Set<String>,
9381
__projection: ShapeQualifiedProjection) {
9482
if ("id" !in ignore && __innerId0) {
95-
__projection.id()
83+
__projection.id
9684
}
9785
if ("opaque" !in ignore && __innerOpaque1) {
98-
__projection.opaque()
86+
__projection.opaque
9987
}
10088
__projection.__onCircle {
10189
this@ShapeQualifiedProjectionImpl.___inner__onCircle.___innerRepeatProjection(setOf(), this)

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/expected/io/github/ermadmi78/kobby/testcases/paint_without_parentheses/kobby/kotlin/entity/impl/SquareImpl.kt.txt

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,32 +101,38 @@ internal class SquareImpl(
101101
internal open class SquareProjectionImpl : SquareProjection {
102102
internal var __innerId0: Boolean = false
103103

104-
internal var __innerOpaque1: Boolean = false
104+
override val id: Any?
105+
get() {
106+
__innerId0 = true
107+
return null
108+
}
105109

106-
internal var __innerLength2: Boolean = false
110+
internal var __innerOpaque1: Boolean = false
107111

108-
override fun id() {
109-
__innerId0 = true
110-
}
112+
override val opaque: Any?
113+
get() {
114+
__innerOpaque1 = true
115+
return null
116+
}
111117

112-
override fun opaque() {
113-
__innerOpaque1 = true
114-
}
118+
internal var __innerLength2: Boolean = false
115119

116-
override fun length() {
117-
__innerLength2 = true
118-
}
120+
override val length: Any?
121+
get() {
122+
__innerLength2 = true
123+
return null
124+
}
119125

120126
@Suppress("UNUSED_PARAMETER", "UNUSED_CHANGED_VALUE", "KotlinConstantConditions")
121127
internal fun ___innerRepeatProjection(ignore: Set<String>, __projection: SquareProjection) {
122128
if ("id" !in ignore && __innerId0) {
123-
__projection.id()
129+
__projection.id
124130
}
125131
if ("opaque" !in ignore && __innerOpaque1) {
126-
__projection.opaque()
132+
__projection.opaque
127133
}
128134
if ("length" !in ignore && __innerLength2) {
129-
__projection.length()
135+
__projection.length
130136
}
131137
}
132138

0 commit comments

Comments
 (0)