Skip to content

Commit

Permalink
fix Issue 6930 - combined type of immutable(T) and inout(T) should be…
Browse files Browse the repository at this point in the history
… inout(const(T))
  • Loading branch information
9rnsr committed Dec 21, 2013
1 parent c895ff7 commit 2c0ead8
Show file tree
Hide file tree
Showing 9 changed files with 672 additions and 353 deletions.
13 changes: 9 additions & 4 deletions src/func.c
Expand Up @@ -119,7 +119,6 @@ void FuncDeclaration::semantic(Scope *sc)
AggregateDeclaration *ad;
ClassDeclaration *cd;
InterfaceDeclaration *id;
bool doesoverride;

#if 0
printf("FuncDeclaration::semantic(sc = %p, this = %p, '%s', linkage = %d)\n", sc, this, toPrettyChars(), sc->linkage);
Expand Down Expand Up @@ -288,27 +287,33 @@ void FuncDeclaration::semantic(Scope *sc)
break;

case STCconst:
case STCwild | STCconst:
type = type->makeConst();
break;

case STCwild:
type = type->makeWild();
break;

case STCwild | STCconst:
type = type->makeWildConst();
break;

case STCshared:
type = type->makeShared();
break;

case STCshared | STCconst:
case STCshared | STCwild | STCconst:
type = type->makeSharedConst();
break;

case STCshared | STCwild:
type = type->makeSharedWild();
break;

case STCshared | STCwild | STCconst:
type = type->makeSharedWildConst();
break;

case 0:
break;

Expand Down Expand Up @@ -487,7 +492,7 @@ void FuncDeclaration::semantic(Scope *sc)
vi = cd->baseClass ? findVtblIndex((Dsymbols*)&cd->baseClass->vtbl, (int)cd->baseClass->vtbl.dim)
: -1;

doesoverride = false;
bool doesoverride = false;
switch (vi)
{
case -1:
Expand Down
2 changes: 2 additions & 0 deletions src/glue.c
Expand Up @@ -1288,13 +1288,15 @@ unsigned Type::totym()
break;
case MODconst:
case MODwild:
case MODwildconst:
t |= mTYconst;
break;
case MODshared:
t |= mTYshared;
break;
case MODshared | MODconst:
case MODshared | MODwild:
case MODshared | MODwildconst:
t |= mTYshared | mTYconst;
break;
case MODimmutable:
Expand Down

0 comments on commit 2c0ead8

Please sign in to comment.