Skip to content

Commit

Permalink
fix issue 15309 again, add proper fix for issue 15550
Browse files Browse the repository at this point in the history
Recognize partial instantiation form inside typeof()
  • Loading branch information
9rnsr committed Feb 1, 2016
1 parent 9863ab6 commit 779142e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/mtype.d
Expand Up @@ -7536,12 +7536,21 @@ public:
}
if (exp.op == TOKscope)
{
ScopeDsymbol sds = (cast(ScopeExp)exp).sds;
auto sds = (cast(ScopeExp)exp).sds;
if (sds.isPackage())
{
error(loc, "%s has no type", exp.toChars());
goto Lerr;
}
if (auto ti = sds.isTemplateInstance())
{
if (ti.needsTypeInference(sc))
{
// Bugzilla 15550: ti is a partial instantiation form fun!tiargs.
error(loc, "expression (%s) has no type", exp.toChars());
goto Lerr;
}
}
}

Type t = exp.type;
Expand Down
3 changes: 3 additions & 0 deletions test/compilable/test15550.d
@@ -1,3 +1,6 @@
// REQUIRED_ARGS: -o-
// PERMUTE_ARGS:

struct Vector(T, int N)
{
void opDispatch(string, U)(U)
Expand Down

0 comments on commit 779142e

Please sign in to comment.