2156 – [] and null should be accepted where a compile-time string is required

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2156 - [] and null should be accepted where a compile-time string is required
Summary: [] and null should be accepted where a compile-time string is required
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
: 2391 6462 (view as issue list)
Depends on:
Blocks:
Reported: 2008年06月19日 11:28 UTC by Max Samukha
Modified: 2014年02月24日 15:59 UTC (History)
3 users (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 Max Samukha 2008年06月19日 11:28:15 UTC
template Foo()
{
 const char[] Foo = [];
}
static assert (Foo!() == ""); // ok
pragma(msg, Foo!()); // fails (1)
mixin("int i;" ~ Foo!()); // fails (2)
void main()
{
}
----
Error messages without line or file:
(1) pragma msg string expected for message, not '[]'
(2) attribute argument to mixin must be a string, not ("int i;" ~ [])
Comment 1 yebblies 2011年06月30日 00:34:35 UTC
*** Issue 2391 has been marked as a duplicate of this issue. ***
Comment 2 yebblies 2011年06月30日 01:04:49 UTC
Fix for D2
https://github.com/D-Programming-Language/dmd/pull/180 
Comment 3 yebblies 2011年08月10日 09:28:19 UTC
*** Issue 6462 has been marked as a duplicate of this issue. ***


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