File tree 1 file changed +14
-2
lines changed
type-system/src/commonMain/kotlin/io/github/charlietap/chasm/type/ext
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ import io.github.charlietap.chasm.type.CompositeType
5
5
import io.github.charlietap.chasm.type.FunctionType
6
6
import io.github.charlietap.chasm.type.StructType
7
7
8
+ inline fun CompositeType.arrayType (): ArrayType ? {
9
+ return (this as ? CompositeType .Array )?.arrayType
10
+ }
11
+
8
12
inline fun CompositeType.functionType (): FunctionType ? {
9
13
return (this as ? CompositeType .Function )?.functionType
10
14
}
@@ -13,6 +17,14 @@ inline fun CompositeType.structType(): StructType? {
13
17
return (this as ? CompositeType .Struct )?.structType
14
18
}
15
19
16
- inline fun CompositeType.arrayType (): ArrayType ? {
17
- return (this as ? CompositeType .Array )?.arrayType
20
+ inline fun CompositeType.asArrayType (): ArrayType {
21
+ return (this as CompositeType .Array ).arrayType
22
+ }
23
+
24
+ inline fun CompositeType.asFunctionType (): FunctionType {
25
+ return (this as CompositeType .Function ).functionType
26
+ }
27
+
28
+ inline fun CompositeType.asStructType (): StructType {
29
+ return (this as CompositeType .Struct ).structType
18
30
}
You can’t perform that action at this time.
0 commit comments