Skip to content

Commit

Permalink
fix-up for the improvement of default argument processing
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jul 4, 2013
1 parent 1fb7a33 commit 752ff1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/cast.c
Expand Up @@ -2214,13 +2214,13 @@ int typeMerge(Scope *sc, Expression *e, Type **pt, Expression **pe1, Expression

if (t1b->ty == ty1) // if no promotions
{
if (t1 == t2)
if (t1->equals(t2))
{
t = t1;
goto Lret;
}

if (t1b == t2b)
if (t1b->equals(t2b))
{
t = t1b;
goto Lret;
Expand All @@ -2242,7 +2242,7 @@ int typeMerge(Scope *sc, Expression *e, Type **pt, Expression **pe1, Expression
t1 = t1b;
t2 = t2b;

if (t1 == t2)
if (t1->equals(t2))
{
// merging can not result in new enum type
if (t->ty == Tenum)
Expand All @@ -2255,7 +2255,7 @@ int typeMerge(Scope *sc, Expression *e, Type **pt, Expression **pe1, Expression
Type *t1n = t1->nextOf();
Type *t2n = t2->nextOf();

if (t1n == t2n)
if (t1n->equals(t2n))
;
else if (t1n->ty == Tvoid) // pointers to void are always compatible
t = t2;
Expand Down Expand Up @@ -2813,8 +2813,8 @@ Expression *Expression::integralPromotions(Scope *sc)

int arrayTypeCompatible(Loc loc, Type *t1, Type *t2)
{
t1 = t1->toBasetype();
t2 = t2->toBasetype();
t1 = t1->toBasetype()->merge2();
t2 = t2->toBasetype()->merge2();

if ((t1->ty == Tarray || t1->ty == Tsarray || t1->ty == Tpointer) &&
(t2->ty == Tarray || t2->ty == Tsarray || t2->ty == Tpointer))
Expand Down
2 changes: 1 addition & 1 deletion src/mtype.c
Expand Up @@ -1895,7 +1895,7 @@ MATCH Type::implicitConvTo(Type *to)
//printf("Type::implicitConvTo(this=%p, to=%p)\n", this, to);
//printf("from: %s\n", toChars());
//printf("to : %s\n", to->toChars());
if (this == to)
if (this->equals(to))
return MATCHexact;
return MATCHnomatch;
}
Expand Down

0 comments on commit 752ff1c

Please sign in to comment.