Skip to content

Commit

Permalink
[changelog] Fix using sequence, not tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrel authored and dlang-bot committed Feb 18, 2022
1 parent 53695a6 commit b051cc6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions changelog/allow_casting_from_typetuple_to_typetuple.dd
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Casting between compatible tuples
Casting between compatible sequences

Prior to this release, casting between built-in tuples of the same type was not allowed.
Prior to this release, casting between built-in sequences of the same type was not allowed.

Starting with this release, casting between tuples of the same length is accepted provided that the underlying types of the casted tuple are implicitly convertible to the target tuple types.
Starting with this release, casting between sequences of the same length is accepted provided that the underlying types of the casted sequence are implicitly convertible to the target sequence types.

---
alias Tuple(T...) = T;
alias Seq(T...) = T;

void foo()
{
Tuple!(int, int) tup;
Seq!(int, int) seq;

auto foo = cast(long) tup;
auto foo = cast(long) seq;
pragma(msg, typeof(foo)); // (int, int)

auto bar = cast(Tuple!(long, int)) tup; // allowed
auto bar = cast(Seq!(long, int)) seq; // allowed
pragma(msg, typeof(bar)); // (long, int)
}
---

0 comments on commit b051cc6

Please sign in to comment.