http://d.puremagic.com/issues/show_bug.cgi?id=10878
Summary: Non-template structs declared inside templates are not inferred Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: major Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: monarchdo...@gmail.com --- Comment #0 from monarchdo...@gmail.com 2013-08-24 04:26:54 PDT --- //---- auto foo(T)(T t) { static struct Result { this(T t) {} } return Result(t); } void main() @safe pure { foo(5); } //---- Error: pure function 'D main' cannot call impure function 'hello.foo!int.foo' Error: safe function 'D main' cannot call system function 'hello.foo!int.foo' //---- Since `struct` is declared in a templated function, then all its functions' attributes should be infered. I *think* this is a bug entry? If not, then it should be an enhancement request that the language behave that way. I'm marking as "Major", because a *lot* of phobos ranges are implemented that way. Because of this, trivial operations, such as "chain([0 .. 2], [3 .. 4])", are considered throwing, unsafe and impure. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------