Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #916 from 9rnsr/fix7560

Issue 7560 - Base class overloaded methods created by mixins can't be overriden
  • Loading branch information...
commit 3e1358125feb935445370000ec883dc4afc3befc 2 parents d303d30 + 7cea8d2
@WalterBright WalterBright authored
Showing with 30 additions and 0 deletions.
  1. +11 −0 src/declaration.c
  2. +19 −0 test/runnable/mixin2.d
View
11 src/declaration.c
@@ -544,6 +544,17 @@ void AliasDeclaration::semantic(Scope *sc)
s->parent = sc->parent;
}
}
+ OverloadSet *o = s->toAlias()->isOverloadSet();
+ if (o)
+ {
+ if (overnext)
+ {
+ o->push(overnext);
+ overnext = NULL;
+ s = o;
+ s->parent = sc->parent;
+ }
+ }
if (overnext)
ScopeDsymbol::multiplyDefined(0, this, overnext);
if (s == this)
View
19 test/runnable/mixin2.d
@@ -161,6 +161,25 @@ void test10()
}
/*********************************************/
+// 7560
+
+class Base7560
+{
+ template getter(T)
+ {
+ void get(ref T[] i, uint n) {}
+ }
+ mixin getter!uint;
+ mixin getter!char;
+}
+
+class Derived7560 : Base7560
+{
+ alias Base7560.get get;
+ void get(ref char[] x) {}
+}
+
+/*********************************************/
void main()
{
Please sign in to comment.
Something went wrong with that request. Please try again.