[Issue 16445] New: string mixin allows shebang line in source

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 29 15:42:53 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16445

          Issue ID: 16445
           Summary: string mixin allows shebang line in source
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: cauterite at gmail.com

This one is so hilarious I just had to submit it:

( https://dpaste.dzfl.pl/c10385f97af5 )

void main() {
    mixin(`#! asdf wxyz
        import std.stdio; writeln("LOL");
    `);
};

The only possible use for this feature I can think of is:
mixin(import("something.d"));
which is a pretty rare usage for mixins (I hope).

--


More information about the Digitalmars-d-bugs mailing list