@@ -33,6 +33,10 @@ inline def inputVariadicity[Elem] = inline erasedValue[Elem] match
33
33
case _ : Variadic [t] => Variadicity .Variadic
34
34
case _ => Variadicity .Single
35
35
36
+ // for some reason match types do not work here, as an inline erasedValue[unwrappedInput[Elem]]
37
+ // tries to match on that type exactly (ie. unwrappedType[Value[IntegerType]] for example) rather than the matched type...
38
+ // very weird things going on
39
+
36
40
/** Produces an OpInput to OperationDef given a definition of a Type.
37
41
*
38
42
* @return
@@ -43,29 +47,43 @@ inline def getDefInput[Label, Elem]: OpInput = {
43
47
44
48
val name = inline erasedValue[Label ] match
45
49
case _ : String => constValue[Label ].asInstanceOf [String ]
46
- case _ => throw new Exception (" Internal error!" )
50
+ case _ =>
51
+ throw new Exception (" Internal error!" )
52
+
47
53
inline erasedValue[Elem ] match
54
+ case _ : Variadic [Operand [t]] =>
55
+ OperandDef (
56
+ id = name,
57
+ typeString = typeToString[t],
58
+ Variadicity .Variadic
59
+ )
60
+ case _ : Variadic [Result [t]] =>
61
+ OperandDef (
62
+ id = name,
63
+ typeString = typeToString[t],
64
+ Variadicity .Variadic
65
+ )
48
66
case _ : Result [t] =>
49
67
ResultDef (
50
68
id = name,
51
69
typeString = typeToString[t],
52
- inputVariadicity[ Elem ]
70
+ Variadicity . Single
53
71
)
54
72
case _ : Operand [t] =>
55
73
OperandDef (
56
74
id = name,
57
75
typeString = typeToString[t],
58
- inputVariadicity[ Elem ]
76
+ Variadicity . Single
59
77
)
60
78
case _ : Region =>
61
79
RegionDef (
62
80
id = name,
63
- inputVariadicity[ Elem ]
81
+ Variadicity . Single
64
82
)
65
83
case _ : Successor =>
66
84
SuccessorDef (
67
85
id = name,
68
- inputVariadicity[ Elem ]
86
+ Variadicity . Single
69
87
)
70
88
case _ : Property [t] =>
71
89
OpPropertyDef (
@@ -77,8 +95,10 @@ inline def getDefInput[Label, Elem]: OpInput = {
77
95
id = name,
78
96
typeString = typeToString[t]
79
97
)
80
- case shennanigan =>
81
- throw new Exception (f " Unsupported shennaigans with field $name" )
98
+ case _ =>
99
+ throw new Exception (
100
+ s " Unsupported shennaigans here with field $name of type ${typeToString[Elem ]}"
101
+ )
82
102
}
83
103
84
104
/** Loops through a Tuple of Input definitions and produces a List of inputs to
0 commit comments