[Issue 16445] string mixin allows shebang line in source
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Aug 29 17:24:02 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16445
b2.temp at gmx.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |b2.temp at gmx.com
--- Comment #1 from b2.temp at gmx.com ---
Yes that's funny. I've tried to understand why this is accepted.
If you compile this
°°°°°a.d°°°°°°
enum t = "#line 1\n#!a";
mixin(t);
°°°°°°°°°°°°°°
you get why this is accepted: mixin are normally located on line 1. When the
shebang is explicitly mixed on a certain line that > 1, the normal error
appears.
So there is no bug. The shebang is removed as specified. You can also see that
if you add a space before, an error is emitted.
--
More information about the Digitalmars-d-bugs
mailing list