[Issue 17309] New: constructor template doesn't infer `pure`
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Apr 8 06:01:04 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17309
Issue ID: 17309
Summary: constructor template doesn't infer `pure`
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: ag0aep6g at gmail.com
Found by Russel Winder who posted to D.learn:
http://forum.dlang.org/post/mailman.1458.1491584811.31550.digitalmars-d-learn@puremagic.com
----
struct BigInt
{
this(Range)(Range s) {} /* `pure` should be inferred, but apparently isn't
*/
}
void main()
{
auto y = immutable BigInt(""); /* rejected, should be accepted */
}
----
Exact error message:
----
test.d(8): Error: template test.BigInt.__ctor cannot deduce function from
argument types !()(string) immutable, candidates are:
test.d(3): test.BigInt.__ctor(Range)(Range s)
----
--
More information about the Digitalmars-d-bugs
mailing list