From 18c1598dc4b015edfdd054e5f70d6ca359c480c9 Mon Sep 17 00:00:00 2001 From: Andrey Zherikov Date: Wed, 24 Aug 2022 14:17:55 -0400 Subject: [PATCH] Fix for dip1000 (#69) * Add dip1000 build to workflow * Fix for dip1000 --- .github/workflows/build.yaml | 5 +++++ source/argparse/internal.d | 2 +- source/argparse/package.d | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9de9390..91f38aa 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,6 +27,11 @@ jobs: - name: Run tests run: dub test --build=unittest-cov + - name: Run tests (dip1000) + env: + DFLAGS: -dip1000 + run: dub test --build=unittest-cov + - name: Build examples run: dub --root examples build --parallel diff --git a/source/argparse/internal.d b/source/argparse/internal.d index ce36610..24f0226 100644 --- a/source/argparse/internal.d +++ b/source/argparse/internal.d @@ -617,7 +617,7 @@ package alias ParsingArgument(alias symbol, alias uda, ArgumentInfo info, RECEIV } }; -package auto ParsingSubCommandArgument(COMMAND_TYPE, CommandInfo info, RECEIVER, alias symbol, bool completionMode)(const CommandArguments!RECEIVER* parentArguments) +package auto ParsingSubCommandArgument(COMMAND_TYPE, CommandInfo info, RECEIVER, alias symbol, bool completionMode)(scope const CommandArguments!RECEIVER* parentArguments) { return delegate(Config* config, ref Parser parser, const ref Parser.Argument arg, bool isDefaultCmd, ref RECEIVER receiver) { diff --git a/source/argparse/package.d b/source/argparse/package.d index 1bdf087..3e7b0e9 100644 --- a/source/argparse/package.d +++ b/source/argparse/package.d @@ -423,7 +423,7 @@ auto PositionalArgument(uint pos, string name) auto NamedArgument(string[] name...) { - return ArgumentUDA!(ValueParseFunctions!(void, void, void, void, void, void))(ArgumentInfo(name)).Optional(); + return ArgumentUDA!(ValueParseFunctions!(void, void, void, void, void, void))(ArgumentInfo(name.dup)).Optional(); } auto NamedArgument(string name)