We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e54f6c5 commit c19e88aCopy full SHA for c19e88a
source/modules/soul_core/compiler/soul_ResolutionPass.h
@@ -1147,6 +1147,15 @@ struct ResolutionPass final
1147
}
1148
else if (targetType.isArrayOrVector())
1149
{
1150
+ if (numArgs == 1)
1151
+ {
1152
+ if (auto constant = list.items.front()->getAsConstant())
1153
+ if (TypeRules::canCastTo (targetType, constant->value.getType()))
1154
+ return allocator.allocate<AST::Constant> (expr.context, constant->value.castToTypeExpectingSuccess (targetType));
1155
+
1156
+ return expr;
1157
+ }
1158
1159
SanityCheckPass::throwErrorIfWrongNumberOfElements (expr.context, targetType, numArgs);
1160
1161
auto elementType = targetType.getElementType();
0 commit comments