Bug 5615 – std.string.indexOf broken at compile time

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-02-19T15:03:00Z
Last change time
2011-06-11T06:41:11Z
Keywords
rejects-valid
Assigned to
nobody
Creator
spam

Comments

Comment #0 by spam — 2011-02-19T15:03:49Z
This is a regression. The code used to work in dmd2.051: import std.string:indexOf; static assert(indexOf("foobar","foo")==0);
Comment #1 by spam — 2011-02-19T15:05:15Z
in dmd2.052 it says: \src\phobos\std\string.d(578): Error: cast(const(char)*)balance cannot be interpreted at compile time main.d(6): Error: cannot evaluate indexOf("foobar","foo",cast(CaseSensitive)1) at compile time main.d(6): Error: static assert (indexOf("foobar","foo",cast(CaseSensitive)1) == 0) is not evaluatable at compile time
Comment #2 by clugdbug — 2011-06-11T06:41:11Z