Skip to content

Commit 3b7cd10

Browse files
actions-userrenovate[bot]
authored andcommitted
Update all dependencies
| datasource | package | from | to | | ---------- | ----------------------------------------------------- | ------ | ------ | | maven | com.javiersc.hubdle:hubdle-version-catalog | 0.13.0 | 0.13.1 | | maven | com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin | 0.18.1 | 0.18.2 |
1 parent 9f25a83 commit 3b7cd10

6 files changed

Lines changed: 92 additions & 96 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
### Updated
1616

17+
- `com.javiersc.hubdle:hubdle-version-catalog -> 0.13.1`
18+
- `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.18.2`
1719
- `gradle -> 9.5.0`
1820
- `org.jetbrains.kotlin:kotlin-gradle-plugin -> 2.3.21`
1921

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
2-
hubdle = "0.18.1"
3-
hubdleCatalog = "0.13.0"
2+
hubdle = "0.18.2"
3+
hubdleCatalog = "0.13.1"
44
javiersc-kotlin-compiler-extensions = "0.13.0+2.3.20"
55
jetbrains-kotlin = "2.3.21"
66

kopy-compiler/main/kotlin/com/javiersc/kotlin/kopy/compiler/fir/generation/FirKopyDeclarationGenerationExtension.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ internal class FirKopyDeclarationGenerationExtension(
345345
visibility = calculateVisibility(owner)
346346
this.extensionReceiverType { typeParameters ->
347347
val typeParamsAsConeType: List<ConeTypeParameterType> =
348-
typeParameters.map { it.toConeType() }
348+
typeParameters.map {
349+
it.toConeType()
350+
}
349351
session
350352
.substitutor(
351353
fromTypeParameters = iterableClass.typeParameterSymbols,

kopy-compiler/main/kotlin/com/javiersc/kotlin/kopy/compiler/ir/transformers/IrFunctionsTransformer.kt

Lines changed: 67 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -102,90 +102,84 @@ internal class IrFunctionsTransformer(
102102

103103
context(context: IrPluginContext)
104104
private fun transformSetFunction(declaration: IrSimpleFunction): IrSimpleFunction {
105-
val function: IrSimpleFunction =
106-
declaration.apply {
107-
body =
108-
DeclarationIrBuilder(declaration.symbol).irBlockBody {
109-
val unitClass: IrClassSymbol = context.irBuiltIns.unitClass.owner.symbol
110-
val unitCall: IrGetObjectValue = irGetObject(unitClass)
111-
val irReturn: IrReturn = irReturn(unitCall)
112-
+irReturn
113-
}
114-
}
105+
val function: IrSimpleFunction = declaration.apply {
106+
body =
107+
DeclarationIrBuilder(declaration.symbol).irBlockBody {
108+
val unitClass: IrClassSymbol = context.irBuiltIns.unitClass.owner.symbol
109+
val unitCall: IrGetObjectValue = irGetObject(unitClass)
110+
val irReturn: IrReturn = irReturn(unitCall)
111+
+irReturn
112+
}
113+
}
115114
return function
116115
}
117116

118117
context(context: IrPluginContext)
119118
private fun transformUpdateFunction(declaration: IrSimpleFunction): IrSimpleFunction {
120-
val function: IrSimpleFunction =
121-
declaration.apply {
122-
body =
123-
DeclarationIrBuilder(declaration.symbol).irBlockBody {
124-
val thisGet: IrGetValue = irGet(extensionReceiver!!)
125-
val transformValueParameter: IrValueParameter = regularParameters.first()
126-
val func1Invoke: IrSimpleFunction =
127-
function1Class.findDeclaration<IrSimpleFunction> {
128-
it.name == invokeName
129-
}!!
130-
131-
val transformCallDispatchReceiver: IrGetValue =
132-
irGet(transformValueParameter).apply {
133-
origin = IrStatementOrigin.VARIABLE_AS_FUNCTION
134-
}
135-
136-
val transformCall: IrMemberAccessExpression<*> =
137-
irCallOp(
138-
callee = func1Invoke.symbol,
139-
type = declaration.typeParameters.first().defaultType,
140-
dispatchReceiver = transformCallDispatchReceiver,
141-
argument = thisGet,
142-
origin = IrStatementOrigin.INVOKE,
143-
)
144-
+typeOperator(
145-
resultType = unitType,
146-
argument = transformCall,
147-
typeOperator = IrTypeOperator.IMPLICIT_COERCION_TO_UNIT,
148-
typeOperand = unitType,
119+
val function: IrSimpleFunction = declaration.apply {
120+
body =
121+
DeclarationIrBuilder(declaration.symbol).irBlockBody {
122+
val thisGet: IrGetValue = irGet(extensionReceiver!!)
123+
val transformValueParameter: IrValueParameter = regularParameters.first()
124+
val func1Invoke: IrSimpleFunction =
125+
function1Class.findDeclaration<IrSimpleFunction> { it.name == invokeName }!!
126+
127+
val transformCallDispatchReceiver: IrGetValue =
128+
irGet(transformValueParameter).apply {
129+
origin = IrStatementOrigin.VARIABLE_AS_FUNCTION
130+
}
131+
132+
val transformCall: IrMemberAccessExpression<*> =
133+
irCallOp(
134+
callee = func1Invoke.symbol,
135+
type = declaration.typeParameters.first().defaultType,
136+
dispatchReceiver = transformCallDispatchReceiver,
137+
argument = thisGet,
138+
origin = IrStatementOrigin.INVOKE,
149139
)
150-
}
151-
}
140+
+typeOperator(
141+
resultType = unitType,
142+
argument = transformCall,
143+
typeOperator = IrTypeOperator.IMPLICIT_COERCION_TO_UNIT,
144+
typeOperand = unitType,
145+
)
146+
}
147+
}
152148
return function
153149
}
154150

155151
context(context: IrPluginContext)
156152
private fun transformUpdateEachFunction(declaration: IrSimpleFunction): IrSimpleFunction {
157-
val function: IrSimpleFunction =
158-
declaration.apply {
159-
body =
160-
DeclarationIrBuilder(declaration.symbol).irBlockBody {
161-
val thisGet: IrGetValue = irGet(extensionReceiver!!)
162-
val transformValueParameter: IrValueParameter = regularParameters.first()
163-
val transformParameterIndex: Int =
164-
transformValueParameter.indexInParameters - 1
165-
166-
val transformCallType: IrSimpleType =
167-
listClass.typeWith(typeParameters.map { it.defaultType })
168-
169-
val typeParameterType: IrSimpleType =
170-
declaration.typeParameters.map { it.defaultType }.first()
171-
172-
val transformCall: IrCall =
173-
irCall(callee = mapFunction.symbol).apply {
174-
typeArguments[0] = typeParameterType
175-
typeArguments[1] = typeParameterType
176-
insertExtensionReceiver(thisGet)
177-
arguments[transformParameterIndex] = irGet(transformValueParameter)
178-
this.type = transformCallType
179-
}
180-
181-
+typeOperator(
182-
resultType = unitType,
183-
argument = transformCall,
184-
typeOperator = IrTypeOperator.IMPLICIT_COERCION_TO_UNIT,
185-
typeOperand = unitType,
186-
)
187-
}
188-
}
153+
val function: IrSimpleFunction = declaration.apply {
154+
body =
155+
DeclarationIrBuilder(declaration.symbol).irBlockBody {
156+
val thisGet: IrGetValue = irGet(extensionReceiver!!)
157+
val transformValueParameter: IrValueParameter = regularParameters.first()
158+
val transformParameterIndex: Int = transformValueParameter.indexInParameters - 1
159+
160+
val transformCallType: IrSimpleType =
161+
listClass.typeWith(typeParameters.map { it.defaultType })
162+
163+
val typeParameterType: IrSimpleType =
164+
declaration.typeParameters.map { it.defaultType }.first()
165+
166+
val transformCall: IrCall =
167+
irCall(callee = mapFunction.symbol).apply {
168+
typeArguments[0] = typeParameterType
169+
typeArguments[1] = typeParameterType
170+
insertExtensionReceiver(thisGet)
171+
arguments[transformParameterIndex] = irGet(transformValueParameter)
172+
this.type = transformCallType
173+
}
174+
175+
+typeOperator(
176+
resultType = unitType,
177+
argument = transformCall,
178+
typeOperator = IrTypeOperator.IMPLICIT_COERCION_TO_UNIT,
179+
typeOperand = unitType,
180+
)
181+
}
182+
}
189183
return function
190184
}
191185

kopy-compiler/main/kotlin/com/javiersc/kotlin/kopy/compiler/ir/transformers/IrSetOrUpdateCallTransformer.kt

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ internal class IrSetOrUpdateCallTransformer(
107107
context(pluginContext) {
108108
createAlsoCall(expressionCall, parent) ?: return original()
109109
}
110-
val expressionWithAlsoCall: IrCall =
111-
alsoCall.also { it.insertExtensionReceiver(expression) }
110+
val expressionWithAlsoCall: IrCall = alsoCall.also {
111+
it.insertExtensionReceiver(expression)
112+
}
112113
return expressionWithAlsoCall
113114
}
114115
}
@@ -131,10 +132,9 @@ internal class IrSetOrUpdateCallTransformer(
131132
createAlsoCall(expressionCall, parent) ?: return original()
132133
}
133134
val value: IrExpression = expression.value
134-
val expressionWithAlsoCall: IrReturn =
135-
expression.also { irReturn ->
136-
irReturn.value = alsoCall.also { it.insertExtensionReceiver(value) }
137-
}
135+
val expressionWithAlsoCall: IrReturn = expression.also { irReturn ->
136+
irReturn.value = alsoCall.also { it.insertExtensionReceiver(value) }
137+
}
138138
return expressionWithAlsoCall
139139
}
140140
}
@@ -253,16 +253,15 @@ internal class IrSetOrUpdateCallTransformer(
253253
}
254254
.reversed()
255255

256-
val copyChainCall: IrCall =
257-
calls.reduce { acc, irCall ->
258-
val argumentIndex: Int =
259-
irCall.getArgumentsWithIr().firstNotNullOfOrNull { (valueParameter, _) ->
260-
val index: Int = valueParameter.descriptor.indexOrMinusOne
261-
if (index != -1) index + 1 else null
262-
} ?: return null
263-
irCall.arguments[argumentIndex] = acc
264-
irCall
265-
}
256+
val copyChainCall: IrCall = calls.reduce { acc, irCall ->
257+
val argumentIndex: Int =
258+
irCall.getArgumentsWithIr().firstNotNullOfOrNull { (valueParameter, _) ->
259+
val index: Int = valueParameter.descriptor.indexOrMinusOne
260+
if (index != -1) index + 1 else null
261+
} ?: return null
262+
irCall.arguments[argumentIndex] = acc
263+
irCall
264+
}
266265

267266
copyChainCall
268267
.toIrTreeNode()

kopy-compiler/main/kotlin/com/javiersc/kotlin/kopy/compiler/measure.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@ internal fun KopyConfig.createReport() {
7474
val reportPath: String = reportDir.path
7575
val reportContent: String = buildString {
7676
var total: Duration = 0.milliseconds
77-
val sortedMeasures: List<Measure> =
78-
measures.sortedWith { a: Measure, b: Measure ->
79-
compareValuesBy(a = a, b = b, { it.key }, { -it.duration })
80-
}
77+
val sortedMeasures: List<Measure> = measures.sortedWith { a: Measure, b: Measure ->
78+
compareValuesBy(a = a, b = b, { it.key }, { -it.duration })
79+
}
8180
for ((key: String, measures: List<Measure>) in sortedMeasures.groupBy { it.key }) {
8281
val values: Sequence<Pair<String, Duration>> =
8382
measures.asSequence().map { measure ->

0 commit comments

Comments
 (0)