Create a bugzilla entry for the issue. Be sure to mark it as an enhancement if it's new functionality.
Creating a patchImportant
: Instead of creating a patch, consider creating a PullRequest
The DMD, Phobos and druntime source code is distributed together with DMD, and is also stored on github: D-Programming-Language
If not using git, simply use the "diff" utility to compare the original and modified working tree. If using git, you can use the "git diff" command for simple modifications. Pipe the "diff" output to a file with the ".patch" extension.
Submitting a patch
- Attach the patch file to the relevant bug report.
- Add the patch keyword to the bug report.
Making it more likely that your patch is accepted
- Test it.
- Test it again.
- Test it by patching a clean copy of Phobos/druntime/the DMD source.
- Submit test cases.
A test case should be a standalone program that will compile without errors, producing an executable that exits with status 0, on success; or on failure, either fails to compile or exits with a status other than 0. Note that a failed assert or an uncaught exception will generate a non-zero exit status. The test should pass with any combination of compile options (such as -w, -O, -release, -g
...). A good test will be short and readable, and ideally produce a reasonable error message on failure.
If your patch fixed an accepts-invalid bug, you can use static if (is (typeof)) or __traits(compiles) to test it. For instance, here is a test case for bug #314, regarding private renamed imports being accessible:
private import io = std.stdio;
static assert (!is (typeof (io.writefln)), "private renamed import from another module is visible");