diff --git a/src/tuple.cr b/src/tuple.cr index 3c9efe414421..2f9cde352e4f 100644 --- a/src/tuple.cr +++ b/src/tuple.cr @@ -545,7 +545,11 @@ struct Tuple # {1, 2, 3, 4, 5}.to_a # => [1, 2, 3, 4, 5] # ``` def to_a : Array(Union(*T)) - to_a(&.itself) + {% if compare_versions(Crystal::VERSION, "1.1.0") < 0 %} + to_a(&.itself.as(Union(*T))) + {% else %} + to_a(&.itself) + {% end %} end # Returns an `Array` with the results of running *block* against each element of the tuple.