[dmd-internals] Three patches for recent regressions

Don Clugston dclugston at googlemail.com
Fri Sep 3 11:36:00 PDT 2010


On 2 September 2010 09:58, Don Clugston <dclugston at googlemail.com> wrote:
> On 31 August 2010 11:04, Don Clugston <dclugston at googlemail.com> wrote:
>> 4751 Regression(1.062, 2.047) ICE(constfold.c) >> after error
>> 4753 fail_compilation/fail116.d sends dmd into a loop, exhausting memory
>> 4771 fail_compilation/fail274.d hits a halt in iasm.c
>>
>> I suggest we introduce a policy for compiler releases: "No regressions
>> more recent than 2.041/1.057".
>> We can gradually push this back until all regressions are gone.
>
> There are two other regressions with patches:
>
> 4430 Regression(2.037) erroneous matching on specialized template function
> 3627 -of with a filename with a double extension confuses linker
>
> If all those are fixed, we'll be down to 7 D2-specific regressions, 5
> D1-specific regressions, and 2 which are common to both. (There are a
> couple of other bugs tagged as 'regression', but which have never
> actually worked correctly).
>

And I just created my most fun patch for a long time. Fixes 3 bugs at
once. See bug 4173.

4173 Regression(2.037) Explicitly instantiated templates still try to
do IFTI in some cases
1715 Template specialization checks for equality rather than convertibility
1970 Templated interfaces not matched

I fixed the regression by allowing arbitrary type deduction of
templated base classes and interfaces. This lets you do crazy stuff
like this:

interface TwoWay(A,B) {}
class C1: TwoWay!(char, float), TwoWay!(int, float) {}
class C2: TwoWay!(float, char) {}
class C3 : C2, TwoWay!(int, char) {}

C1 twoway;
C3 twoway2;
B foo(A, B)(TwoWay!(A, B) x, TwoWay!(B, A) y) { return B.init;}

static assert(is(typeof(foo(twoway, twoway2)) == float));
static assert(is(typeof(foo(twoway2, twoway)) == char));


More information about the dmd-internals mailing list