Skip to content

Commit 86b117b

Browse files
authored
Merge pull request #12516 from MartinNowak/merge_stable
merge stable merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2 parents 8fbacc3 + 442203f commit 86b117b

7 files changed

Lines changed: 55 additions & 7 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.096.1
1+
v2.097.0-beta.1

src/dmd/dsymbolsem.d

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6610,8 +6610,11 @@ void aliasInstanceSemantic(TemplateInstance tempinst, Scope* sc, TemplateDeclara
66106610

66116611
TemplateTypeParameter ttp = (*tempdecl.parameters)[0].isTemplateTypeParameter();
66126612
Type ta = tempinst.tdtypes[0].isType();
6613-
Declaration d = new AliasDeclaration(tempinst.loc, ttp.ident, ta.addMod(tempdecl.onemember.isAliasDeclaration.type.mod));
6614-
d.storage_class |= STC.templateparameter;
6613+
auto ad = tempdecl.onemember.isAliasDeclaration();
6614+
6615+
// Note: qualifiers can be in both 'ad.type.mod' and 'ad.storage_class'
6616+
Declaration d = new AliasDeclaration(tempinst.loc, ttp.ident, ta.addMod(ad.type.mod));
6617+
d.storage_class |= STC.templateparameter | ad.storage_class;
66156618
d.dsymbolSemantic(sc);
66166619

66176620
paramscope.pop();

src/dmd/escape.d

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,9 +1847,10 @@ void escapeByRef(Expression e, EscapeByResults* er, bool live = false)
18471847
*/
18481848
if (ExpInitializer ez = v._init.isExpInitializer())
18491849
{
1850-
assert(ez.exp && ez.exp.op == TOK.construct);
1851-
Expression ex = (cast(ConstructExp)ez.exp).e2;
1852-
ex.accept(this);
1850+
if (auto ce = ez.exp.isConstructExp())
1851+
ce.e2.accept(this);
1852+
else
1853+
ez.exp.accept(this);
18531854
}
18541855
}
18551856
else

src/dmd/expressionsem.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2346,7 +2346,7 @@ private bool functionParameters(const ref Loc loc, Scope* sc,
23462346

23472347
/* Declare temporary 'auto __pfx = arg' (needsDtor) or 'auto __pfy = arg' (!needsDtor)
23482348
*/
2349-
auto tmp = copyToTemp(0,
2349+
auto tmp = copyToTemp(parameter.storageClass & (STC.scope_),
23502350
needsDtor ? "__pfx" : "__pfy",
23512351
!isRef ? arg : arg.addressOf());
23522352
tmp.dsymbolSemantic(sc);

test/compilable/issue21880.d

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// REQUIRED_ARGS: -preview=dip1000
2+
// https://issues.dlang.org/show_bug.cgi?id=21880
3+
extern(C++):
4+
void spawnProcess(scope const(char*)*, File = File()) @safe
5+
{
6+
}
7+
8+
void pipeProcess(scope const(char*)* args) @safe
9+
{
10+
pipeProcessImpl!spawnProcess(args);
11+
}
12+
13+
void pipeProcessImpl(alias spawnFunc, Cmd)(Cmd command) @trusted
14+
{
15+
spawnFunc(command);
16+
}
17+
18+
struct File
19+
{
20+
~this() @safe
21+
{
22+
}
23+
}

test/compilable/issue21882.d

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// REQUIRED_ARGS: -preview=dip1021
2+
// https://issues.dlang.org/show_bug.cgi?id=21882
3+
bool buildPath()
4+
{
5+
struct ByCodeUnitImpl
6+
{
7+
auto opIndex(size_t) { }
8+
}
9+
return isRandomAccessRange!ByCodeUnitImpl;
10+
}
11+
12+
enum isRandomAccessRange(R) = is(typeof(lvalueOf!R[1]));
13+
14+
ref T lvalueOf(T)();

test/compilable/test21898.d

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// https://issues.dlang.org/show_bug.cgi?id=21898
2+
3+
alias Works(T) = immutable(T);
4+
alias Fails(T) = immutable T;
5+
6+
static assert(is(Works!int == immutable int));
7+
static assert(is(Fails!int == immutable int));

0 commit comments

Comments
 (0)