Bug 7794 – Sea of errors when calling regex() after compile error
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-03-29T09:17:00Z
Last change time
2012-03-29T15:17:09Z
Keywords
diagnostic
Assigned to
nobody
Creator
kekeniro2
Comments
Comment #0 by kekeniro2 — 2012-03-29T09:17:42Z
I am working on D2059 head.
Building the following code, I get 60+ lines of error message.
D2058 outputs only one error.
---------------------------------------
import std.regex;
void main()
{
0; // to cause the _first_ compile error
regex("a");
}
---------------------------------------
I believe that it relates to the issue 7557.
Comment #1 by kekeniro2 — 2012-03-29T09:25:41Z
Reduced code is here.
( I wanted to reduce more but couldn't )
---------------------------------------------
// from std.typetuple
template TypeTuple(T...) {
alias T TypeTuple;
}
template staticMap( T...) {
static if (T.length == 0) {
alias TypeTuple!() staticMap;
} else {
alias TypeTuple!( staticMap!( T[1 .. $] ) ) staticMap;
}
}
// from std.typecons
struct Tuple(U) {
template FieldSpec() { }
template parseSpecs(T...) {
static if (T.length == 0) {
alias TypeTuple!() parseSpecs;
} else {
alias TypeTuple!( FieldSpec!(),
parseSpecs!( T[1 .. $] ) ) parseSpecs;
}
}
alias staticMap!( parseSpecs!U ) Types;
}
// instantiating
void main()
{
0; // to cause the _first_ error
Tuple!int a;
}