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: nob...@puremagic.com Reporter: ag0ae...@gmail.com Found by Russel Winder who posted to D.learn: http://forum.dlang.org/post/mailman.1458.1491584811.31550.digitalmars-d-le...@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) ---- --