blachlylab / dhtslib

D bindings and OOP wrappers for htslib
MIT License
7 stars 1 forks source link

dmd can't inline SAMRecord.pos #47

Closed charlesgregory closed 4 years ago

charlesgregory commented 4 years ago
../../../dhtslib/source/dhtslib/sam/package.d(103,20): Error: function `dhtslib.sam.SAMRecord.pos` cannot inline function

fixed with:

    /// 0-based leftmost coordinate
    @nogc @safe nothrow
    @property long pos() {
        version(LDC) pragma(inline, true);
        version(DigitalMars) pragma(inline);
        return this.b.core.pos;
    }
charlesgregory commented 4 years ago

Also now using the latest version of dmd, we are having issues with SAMRecord.length:

../../../dhtslib/source/dhtslib/sam/package.d(253,19): Error: function dhtslib.sam.SAMRecord.length cannot inline function
jblachly commented 4 years ago

It is likely that DMD could never inline those, I doubt it has anything to do with new compiler could have something to do with switch to long return type however

charlesgregory commented 4 years ago

Actually these are only an issue when using the profile build for dmd.