In/out contract inheritance in gdc

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Fri Apr 13 14:36:54 PDT 2012


Hello all,

I've come across a compilation problem with gdc 4.6.3 (the package in the Ubuntu 
repositories).

I have some code, available from
https://github.com/WebDrake/SampleD

... which uses in contracts on some class functions: a base class has one in 
contract for one of its methods (lines 16-26), and a subclass overrides this 
method and provides its own in contract (lines 50-66).

If I compile without the -release switch, e.g.

    gdmd -O -inline -oftest sampled.d

I get the following error:

    sampled.d:50: Error: function [classname].select cannot get frame pointer to
    __require

Is this an instance of this bug?
https://bitbucket.org/goshawk/gdc/issue/78/d1-d2-in-out-contract-inheritance

... or something different?

The code compiles without problem using regular dmd.

'Tis a shame, as in general I'm finding gdc much preferable to dmd -- the code 
it produces is much, much faster!

Thanks and best wishes,

     -- Joe


More information about the D.gnu mailing list