Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1404 from 9rnsr/fix7252

Issue 7252 - ICE(template.c): 'global.errors' on line 4893 in file 'template.c'
  • Loading branch information...
commit 1aaeb4a8a1c9bf74fd1c1fb64c4820b0fcdbebab 2 parents 8ad7a53 + 200888e
@WalterBright WalterBright authored
Showing with 13 additions and 2 deletions.
  1. +2 −1  src/cast.c
  2. +1 −1  src/mtype.c
  3. +10 −0 test/compilable/test7252.d
View
3  src/cast.c
@@ -2132,11 +2132,12 @@ int typeMerge(Scope *sc, Expression *e, Type **pt, Expression **pe1, Expression
if (t1->ty == Tdelegate)
{
tx = new TypeDelegate(d);
- tx = tx->merge();
}
else
tx = d->pointerTo();
+ tx = tx->semantic(e1->loc, sc);
+
if (t1->implicitConvTo(tx) && t2->implicitConvTo(tx))
{
t = tx;
View
2  src/mtype.c
@@ -1650,7 +1650,7 @@ Type *Type::merge()
if (ty == Tinstance) return this;
if (ty == Taarray && !((TypeAArray *)this)->index->merge()->deco)
return this;
- if (nextOf() && !nextOf()->merge()->deco)
+ if (nextOf() && !nextOf()->deco)
return this;
//printf("merge(%s)\n", toChars());
View
10 test/compilable/test7252.d
@@ -0,0 +1,10 @@
+alias char* function() Func;
+
+alias const char* function() CFunc;
+
+void to(S)(S) { }
+
+void foo(CFunc cFunc)
+{
+ to(cFunc());
+}
Please sign in to comment.
Something went wrong with that request. Please try again.