Skip to content

Commit

Permalink
Merge pull request #9470 from Basile-z/issue-19755
Browse files Browse the repository at this point in the history
fix issue 19755 - Compiler crash
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
  • Loading branch information
dlang-bot committed Mar 20, 2019
2 parents 5c3d570 + bfd0429 commit dced499
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dmd/expressionsem.d
Expand Up @@ -1844,7 +1844,7 @@ private bool functionParameters(const ref Loc loc, Scope* sc,
break;
}
if ((wildmatch == MODFlags.mutable || wildmatch == MODFlags.immutable_) &&
tf.next.hasWild() &&
tf.next && tf.next.hasWild() &&
(tf.isref || !tf.next.implicitConvTo(tf.next.immutableOf())))
{
bool errorInout(MOD wildmatch)
Expand Down
16 changes: 16 additions & 0 deletions test/fail_compilation/ice19755.d
@@ -0,0 +1,16 @@
/* TEST_OUTPUT:
---
fail_compilation/ice19755.d(11): Error: no property `x` for type `Thunk!int*`
fail_compilation/ice19755.d(16): Error: template instance `ice19755.Thunk!int` error instantiating
---
*/
struct Thunk(Dummy) {
void opAssign(int dlg) {}
auto get() inout {
Thunk* self;
self.x = 0;
}
alias get this;
}

alias T = Thunk!int;

0 comments on commit dced499

Please sign in to comment.