D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14441 - Strange error with string ctor
Summary: Strange error with string ctor
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-12 12:37 UTC by Temtaime
Modified: 2020-03-21 03:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Temtaime 2015-04-12 12:37:35 UTC
auto s = string(`foo`);

Error: function expected before (), not string of type string

It should be accepted because all built-in types has a ctor.

For example auto a = int(10); works
Comment 1 basile-z 2019-03-20 22:35:52 UTC
string is not a builtin type, it's an alias to an array, so the rule for uniform constructor call doesn't apply.