https://issues.dlang.org/show_bug.cgi?id=14105
Issue ID: 14105
Summary: Odd compiler error involving immutable char[],
assertThrown, and stride
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
In Phobos' std/utf.d there's a unittest:
unittest // invalid start bytes
{
import std.exception: assertThrown;
immutable char[] invalidStartBytes = [
//0b1111_1000, // indicating a sequence length of 5
0b1111_1100, // 6
0b1111_1110, // 7
0b1111_1111, // 8
0b1000_0000, // continuation byte
];
foreach(c; invalidStartBytes)
assertThrown!UTFException(stride([c]));
}
Uncommenting the first element of the array makes the unittest fail. Actually
uncommenting that but commenting another element of the array makes the
unittest pass. The error cannot be reproduced by taking the unittest out.
--