https://issues.dlang.org/show_bug.cgi?id=13589
--- Comment #7 from yebblies <[email protected]> --- (In reply to Kenji Hara from comment #6) > > void f3() @safe pure { > asm {...} > // f3 has explicit @safe attribute, so asm is inferred as @trusted, pure, > but throwable > } > This is a problem. f3 is _not_ @safe, it is @trusted. But unlike other violations, you won't find it by grepping for @trusted. > It could be more serious. If someone want to write a kernel code with D, > mixing inline assembler and regular D code may be painful. It would be a > serious flaw against the goal "D is a system language". I don't think it is a serious flaw against that goal. Everything is still possible, and not very difficult either. I would much rather have the attributes be opt-in than opt-out at the statement level, where the compiler can't decide automatically. > > It is case by case. *In phobos*, it is less than 100 asm, but we would > already have large code base we are unknown. I believe D will be a > widespread language, so we should imagine the quite big use cases even they > are not visible. This isn't an argument that these uses exist and are widespread, and therefore worth catering too. The proposed change is also backwards-compatible. --
