Skip to content

Commit 81ddb88

Browse files
committed
feat: const from invoke on a type
1 parent ef57c81 commit 81ddb88

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

mmrpc-definition/src/commonMain/kotlin/builder/ConstDefinitionBuilder.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,17 @@ fun const(
105105
) = const(struct, value, block)
106106

107107
////////////////////////////////////////
108+
109+
@Marker2
110+
operator fun TypeDefinition.invoke(
111+
value: Literal = null.literal,
112+
block: ConstDefinitionBuilder.() -> Unit = {}
113+
) = const(this, value, block)
114+
115+
@Marker2
116+
operator fun Unnamed<TypeDefinition>.invoke(
117+
value: Literal = null.literal,
118+
block: ConstDefinitionBuilder.() -> Unit = {}
119+
) = const(this, value, block)
120+
121+
////////////////////////////////////////

0 commit comments

Comments
 (0)