5615 – std.string.indexOf broken at compile time

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5615 - std.string.indexOf broken at compile time
Summary: std.string.indexOf broken at compile time
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 regression
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
Reported: 2011年02月19日 15:03 UTC by Stephan Dilly
Modified: 2011年06月11日 06:41 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Dilly 2011年02月19日 15:03:49 UTC
This is a regression. The code used to work in dmd2.051:
import std.string:indexOf;
static assert(indexOf("foobar","foo")==0);
Comment 1 Stephan Dilly 2011年02月19日 15:05:15 UTC
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


AltStyle によって変換されたページ (->オリジナル) /