Added some tests for 'switch', small bug fix.

This commit is contained in:
Matthias Koefferlein
2021-01-15 17:32:39 +01:00
parent ec88362eca
commit bbd511bc8b
4 changed files with 22 additions and 3 deletions
@@ -1516,8 +1516,8 @@ class DRCOpNodeCase < DRCOpNode
types << a.result_type
end
end
if types.sort.uniq.size > 1
raise("All result arguments need to have the same type (we got '" + types.collect(:to_s).join(",") + "')")
if types.uniq { |a,b| a.to_i <=> b.to_i }.size > 1
raise("All result arguments of 'switch' need to render the same type (got '" + types.map!(&:to_s).join(",") + "')")
end
RBA::CompoundRegionOperationNode::new_case(nodes)