Commit 0dbb785
Improve error message for to!string when used on infinite ranges (dlang#10744)
Partial Fix: dlang#10559
Improve the error message to:
static assert(0, "Cannot convert infinite range to string. Use `std.range.take` or `std.range.takeExactly` to make it finite.");
Also add a unittest to verify that compilation fails when an infinite range is passed for string conversion.
Co-authored-by: Paul Backus <[email protected]>1 parent 811f67e commit 0dbb785
1 file changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
546 | 563 | | |
547 | 564 | | |
548 | 565 | | |
| |||
0 commit comments