Skip to content

Commit

Permalink
Fix bug in record.duplicate, which would allow setting of a get_compu…
Browse files Browse the repository at this point in the history
…te property
  • Loading branch information
hmmdyl committed Jul 15, 2021
1 parent 3ce606c commit 33dc99d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/drecord.d
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,13 @@ template record(args...)
mixin("r." ~ item.name_ ~ "_ = this." ~ item.name_ ~ "_;");
import core.vararg;
static foreach(item; AliasSeq!TNames)
{
static foreach(b; AliasSeq!args)
static if(isGetCompute!b)
static assert(b.name_ != item, "Cannot set a get_compute property '" ~ item ~ "'");

mixin("r." ~ item ~ "_ = va_arg!(typeof(" ~ item ~ "_))(_argptr);");
}
r.constructs;
return r;
}
Expand Down

0 comments on commit 33dc99d

Please sign in to comment.