Skip to content

Commit

Permalink
Merge pull request #7346 from MartinNowak/merge_stable
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/stable' into merge_stable
  • Loading branch information
WalterBright committed Nov 30, 2017
2 parents aa59523 + 9a57a96 commit e58519e
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.077.0
v2.077.1
3 changes: 2 additions & 1 deletion src/ddmd/dcast.d
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,8 @@ extern (C++) MATCH implicitConvTo(Expression e, Type t)
MATCH m = MATCH.exact;
if (e.type.nextOf().mod != tn.mod)
{
if (!tn.isConst())
// https://issues.dlang.org/show_bug.cgi?id=16183
if (!tn.isConst() && !tn.isImmutable())
return;
m = MATCH.constant;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/dclass.d
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ extern (C++) class ClassDeclaration : AggregateDeclaration
/* If the base class is not abstract, then this class cannot
* be abstract.
*/
if (!baseClass || !baseClass.isAbstract())
if (!isInterfaceDeclaration() && (!baseClass || !baseClass.isAbstract()))
return no();

/* If any abstract functions are inherited, but not overridden,
Expand Down
19 changes: 12 additions & 7 deletions src/ddmd/dmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -503,20 +503,25 @@ public:
//printf("fd.type = %s\n", fd.type.toChars());
if (fd.needThis() || fd.isNested())
buf.writeByte('M');
if (inParent)

if (!fd.type || fd.type.ty == Terror)
{
// never should have gotten here, but could be the result of
// failed speculative compilation
buf.writestring("9__error__FZ");

//printf("[%s] %s no type\n", fd.loc.toChars(), fd.toChars());
//assert(0); // don't mangle function until semantic3 done.
}
else if (inParent)
{
TypeFunction tf = cast(TypeFunction)fd.type;
TypeFunction tfo = cast(TypeFunction)fd.originalType;
mangleFuncType(tf, tfo, 0, null);
}
else if (fd.type)
{
visitWithMask(fd.type, 0);
}
else
{
printf("[%s] %s no type\n", fd.loc.toChars(), fd.toChars());
assert(0); // don't mangle function until semantic3 done.
visitWithMask(fd.type, 0);
}
}

Expand Down
7 changes: 7 additions & 0 deletions test/compilable/test16183.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// https://issues.dlang.org/show_bug.cgi?id=16183

void main()
{
const string g(const string s) { return s; }
enum string y = ['f'] ~ g("g");
}
18 changes: 18 additions & 0 deletions test/fail_compilation/fail17969.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* TEST_OUTPUT:
---
fail_compilation/fail17969.d(9): Error: no property 'sum' for type 'MapResult2!((b) => b)'
---
* https://issues.dlang.org/show_bug.cgi?id=17969
*/


alias fun = a => MapResult2!(b => b).sum;

int[] e;
static assert(!is(typeof(fun(e)) == void));
void foo() { fun(e); }

struct MapResult2(alias fun)
{
int[] _input;
}

0 comments on commit e58519e

Please sign in to comment.