September 15, 2013 [Issue 11047] New: UDA + getAttributes bypass purity/safety check | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=11047 Summary: UDA + getAttributes bypass purity/safety check Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: maxim@maxim-fomin.ru --- Comment #0 from Maxim Fomin <maxim@maxim-fomin.ru> 2013-09-15 13:59:24 PDT --- Code from February thread: http://www.digitalmars.com/d/archives/digitalmars/D/Possible_UDA_bug_190800.html import std.stdio; int x; @(write(x++),writeln()) void foo(){} @safe pure void main(){ __traits(getAttributes, foo); __traits(getAttributes, foo)[0]; __traits(getAttributes, foo)[0]; //write(x++), writeln(); // Error: ... } By the way, irrespective of attributes, the issue raised in the thread regarding validity of code above should be at least documented (or code rejected if considered to be a bug). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation