Thread overview
how do I activate contracts for phobos functions in dmd
Nov 02, 2018
Richard Palme
Nov 02, 2018
Stefan Koch
Nov 02, 2018
Richard Palme
Nov 03, 2018
Kagamin
November 02, 2018
My guess is that I have to build phobos with:

$make -f posix.mak BUILD=debug

but then what do I do next? I'm using Linux and I built dmd+phobos manually by following this guide: https://wiki.dlang.org/Building_under_Posix
November 02, 2018
On Friday, 2 November 2018 at 14:10:35 UTC, Richard Palme wrote:
> My guess is that I have to build phobos with:
>
> $make -f posix.mak BUILD=debug
>
> but then what do I do next? I'm using Linux and I built dmd+phobos manually by following this guide: https://wiki.dlang.org/Building_under_Posix

Which phobos functions are used in dmd?
there _should_ be none!
November 02, 2018
On Friday, 2 November 2018 at 16:41:32 UTC, Stefan Koch wrote:
> Which phobos functions are used in dmd?
> there _should_ be none!

I think I didn't phrase the title correctly:

I'm using dmd as compiler and want to activate the contracts of phobos functions. For example there's a phobos function std.bitmanip.opIndex implemented like this:

bool opIndex(size_t i) const @nogc pure nothrow
    in {
        assert(i < _len);
    }
    do {
        return cast(bool) bt(_ptr, i);
    }

and when I call this function from my code I want the pre contract to be checked (assert(i < _len)
November 03, 2018
Just compile the needed module directly:
dmd myapp.d src/std/bitmanip.d