Skip to content

Commit

Permalink
Merge pull request #4709 from 9rnsr/fix14568
Browse files Browse the repository at this point in the history
[REG2.067] Issue 14568 - gaggederrors ICE
  • Loading branch information
WalterBright committed Jun 2, 2015
2 parents cd63acf + 00d51e4 commit 7d4e2e8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,8 @@ void FuncDeclaration::semantic3(Scope *sc)
//printf("FuncDeclaration::semantic3(%s '%s', sc = %p)\n", kind(), toChars(), sc);
assert(0);
}
if (isError(parent))
return;
//printf("FuncDeclaration::semantic3('%s.%s', %p, sc = %p, loc = %s)\n", parent->toChars(), toChars(), this, sc, loc.toChars());
//fflush(stdout);
//printf("storage class = x%x %x\n", sc->stc, storage_class);
Expand Down
43 changes: 43 additions & 0 deletions test/runnable/template9.d
Original file line number Diff line number Diff line change
Expand Up @@ -4516,6 +4516,49 @@ struct Hoge14481
enum e = 10;
}

/******************************************/
// 14568

struct Interval14568()
{
auto left = INVALID;

auto opAssign()(Interval14568) { left; }
}

auto interval14568(T)(T point)
{
Interval14568!();
}

alias Instantiate14568(alias symbol, Args...) = symbol!Args;

template Match14568(patterns...)
{
static if (__traits(compiles, Instantiate14568!(patterns[0])))
{
alias Match14568 = patterns[0];
}
else static if (patterns.length == 1)
{}
}

template SubOps14568(Args...)
{
auto opIndex()
{
template IntervalType(T...)
{
alias Point() = typeof(T.interval14568);

alias IntervalType = Match14568!(Point);
}
alias Subspace = IntervalType!(Args);
}
}

struct Nat14568 { mixin SubOps14568!(null); }

/******************************************/

int main()
Expand Down

0 comments on commit 7d4e2e8

Please sign in to comment.