Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dmd/constfold.d
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ UnionExp Slice(Type type, Expression e1, Expression lwr, Expression upr)
{
auto elements = new Expressions(cast(size_t)(iupr - ilwr));
memcpy(elements.tdata(), es1.elements.tdata() + ilwr, cast(size_t)(iupr - ilwr) * ((*es1.elements)[0]).sizeof);
emplaceExp!(ArrayLiteralExp)(&ue, e1.loc, type, elements);
emplaceExp!(ArrayLiteralExp)(&ue, e1.loc, type, es1.basis, elements);
}
}
else
Expand Down
4 changes: 3 additions & 1 deletion compiler/test/compilable/test8717.d
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ static if(SPT.init.sii != 1) { static assert(0); }
static if(SPT.sf() != 1) { static assert(0); }
static if(SPT.init.f() != 1) { static assert(0); }

void main() { }
// https://github.com/dlang/dmd/issues/22699
struct S{ int[8] e; }
static assert(S().e[0..4] == S.init.e[0..4]);
Loading