[Issue 14105] New: Odd compiler error involving immutable char[], assertThrown, and stride
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Feb 1 15:00:38 PST 2015
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: nobody at puremagic.com
Reporter: andrei at erdani.com
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.
--
More information about the Digitalmars-d-bugs
mailing list