if(!left_size || (left_size==1 && right_size!=1) || (left_size>1 && right_size!=1 && right_size!=left_size))
return;
+ /* If the left operand is a vector and right is scalar, convert the right
+ operand to a vector too. */
+ if(left_size>1 && right_size==1)
+ {
+ BasicTypeDeclaration *vec_right = find_type(*elem_right, basic_left->kind, basic_left->size);
+ if(!vec_right)
+ return;
+
+ convert_to(binary.right, *vec_right);
+ }
+
type = basic_left;
// Don't perform conversion even if the operands are of different sizes.
compat = SAME_TYPE;
map<string, TypeDeclaration *>::const_iterator i = stage->types.find(call.name);
if(i==stage->types.end())
return;
+ else if(call.arguments.size()==1 && i->second==call.arguments[0]->type)
+ ;
else if(BasicTypeDeclaration *basic = dynamic_cast<BasicTypeDeclaration *>(i->second))
{
BasicTypeDeclaration *elem = get_element_type(*basic);