Is DMD breaking BigInt?
Meta via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Apr 7 15:47:49 PDT 2017
On Friday, 7 April 2017 at 17:06:31 UTC, Russel Winder wrote:
> Simple Dub build of a Factorial example using Unit-Threaded for
> testing. Works fine with ldc2 breaks with dmd. This is on
> Debian Sid fully up to date.
>
> |> ldc2 --version
> LDC - the LLVM D compiler (1.1.1):
> based on DMD v2.071.2 and LLVM 3.9.1
> built with LDC - the LLVM D compiler (1.1.0)
> Default target: x86_64-pc-linux-gnu
> Host CPU: broadwell
> http://dlang.org - http://wiki.dlang.org/LDC
>
> |> dmd --version
> DMD64 D Compiler v2.073.2
>
> |> dub test --compiler=ldc2
> Package factorial (configuration "unittest") defines no import
> paths, use {"importPaths": [...]} or the default package
> directory structure to fix this.
> Running custom 'unittest' configuration.
> Performing "unittest" build using ldc2 for x86_64.
> unit-threaded 0.7.11: target for configuration "library" is up
> to date.
> factorial ~master: building configuration "unittest"...
> Running pre-build commands...
> Building package unit-threaded in
> /home/users/russel/.dub/packages/unit-threaded-0.7.11/unit-threaded/
> Performing "$DFLAGS" build using dmd for x86_64.
> unit-threaded 0.7.11: building configuration "gen_ut_main"...
> Linking...
> Running
> ../../../../.dub/packages/unit-threaded-0.7.11/unit-threaded/gen_ut_main -f ut_main.d
> To force a rebuild of up-to-date targets, run again with
> --force.
> Running ./factorial-test
>
> Automatically generated file ut_main.d
> Running unit tests from dirs ["."]
> factorial.Check the base case for all algorithms.:
> factorial.Check the property for all algorithms.:
> factorial.Traditional example-based testing.:
>
> Time taken: 34 ms, 363 μs, and 2 hnsecs
> 3 test(s) run, 0 failed.
>
> OK!
>
> |> dub test
> Package factorial (configuration "unittest") defines no import
> paths, use {"importPaths": [...]} or the default package
> directory structure to fix this.
> Running custom 'unittest' configuration.
> Performing "unittest" build using dmd for x86_64.
> unit-threaded 0.7.11: target for configuration "library" is up
> to date.
> factorial ~master: building configuration "unittest"...
> Running pre-build commands...
> Building package unit-threaded in
> /home/users/russel/.dub/packages/unit-threaded-0.7.11/unit-threaded/
> Performing "$DFLAGS" build using dmd for x86_64.
> unit-threaded 0.7.11: building configuration "gen_ut_main"...
> Linking...
> Running
> ../../../../.dub/packages/unit-threaded-0.7.11/unit-threaded/gen_ut_main -f ut_main.d
> factorial.d(71,15): Error: template std.bigint.BigInt.__ctor
> cannot deduce function from argument types !()(string)
> immutable, candidates are:
> /usr/include/dmd/phobos/std/bigint.d(64,5):
> std.bigint.BigInt.__ctor(Range)(Range s) if
> (isBidirectionalRange!Range && isSomeChar!(ElementType!Range)
> && !isInfinite!Range)
> /usr/include/dmd/phobos/std/bigint.d(146,5):
> std.bigint.BigInt.__ctor(T)(T x) if (isIntegral!T)
> /usr/include/dmd/phobos/std/bigint.d(162,5):
> std.bigint.BigInt.__ctor(T)(T x) if (is(Unqual!T == BigInt))
> dmd failed with exit code 1.
>
>
> If anyone has any useful intelligence as to what happening and
> how I
> can workaround it, I'd be a grateful bunny.
Do you have the -dip1000 switch enabled?
More information about the Digitalmars-d-learn
mailing list