Skip to content

Commit

Permalink
fix Issue 13087 - Error: no property 'xyz' for type 'Vec!4'
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jul 10, 2014
1 parent 63c33be commit 3799592
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mtype.c
Expand Up @@ -6510,7 +6510,9 @@ void TypeQualified::resolveHelper(Loc loc, Scope *sc,
if (v->storage_class & (STCconst | STCimmutable | STCmanifest) ||
v->type->isConst() || v->type->isImmutable())
{
goto L3;
// Bugzilla 13087: this.field is not constant always
if (!v->isThisDeclaration())
goto L3;
}
}
if (!sm)
Expand Down
22 changes: 22 additions & 0 deletions test/runnable/template9.d
Expand Up @@ -3456,6 +3456,28 @@ void test9708()
void f12880(T)(in T value) { static assert(is(T == string)); }
void test12880() { f12880(string.init); }

/******************************************/
// 13087

struct Vec13087
{
int x;
void m() { auto n = component13087!(this, 'x'); }
void c() const { auto n = component13087!(this, 'x'); }
void w() inout { auto n = component13087!(this, 'x'); }
void wc() inout const { auto n = component13087!(this, 'x'); }
void s() shared { auto n = component13087!(this, 'x'); }
void sc() shared const { auto n = component13087!(this, 'x'); }
void sw() shared inout { auto n = component13087!(this, 'x'); }
void swc() shared inout const { auto n = component13087!(this, 'x'); }
void i() immutable { auto n = component13087!(this, 'x'); }
}

template component13087(alias vec, char c)
{
alias component13087 = vec.x;
}

/******************************************/

int main()
Expand Down

0 comments on commit 3799592

Please sign in to comment.