Handle nested classes
This commit is contained in:
parent
c487f021f0
commit
9d531db985
|
@ -1273,4 +1273,20 @@ ACTOR Future<int> Foo4::fooActor(Foo4* self) {
|
|||
return self->x;
|
||||
}
|
||||
|
||||
struct Outer {
|
||||
class Foo5 : Super {
|
||||
public:
|
||||
explicit Foo5(int x) : x(x) {}
|
||||
Future<int> foo() { return fooActor(this); }
|
||||
ACTOR static Future<int> fooActor(Foo5* self);
|
||||
|
||||
private:
|
||||
int x;
|
||||
};
|
||||
};
|
||||
ACTOR Future<int> Outer::Foo5::fooActor(Outer::Foo5* self) {
|
||||
wait(Future<Void>());
|
||||
return self->x;
|
||||
}
|
||||
|
||||
ACTOR static Future<Void> shouldNotHaveFriends2();
|
||||
|
|
|
@ -304,8 +304,8 @@ namespace actorcompiler
|
|||
actor.name.Substring(0, 1).ToUpper(),
|
||||
actor.name.Substring(1),
|
||||
i != 0 ? i.ToString() : "",
|
||||
actor.enclosingClass != null ? actor.enclosingClass + "_"
|
||||
: actor.nameSpace != null ? actor.nameSpace + "_"
|
||||
actor.enclosingClass != null ? actor.enclosingClass.Replace("::", "_") + "_"
|
||||
: actor.nameSpace != null ? actor.nameSpace.Replace("::", "_") + "_"
|
||||
: "");
|
||||
if (actor.isForwardDeclaration || usedClassNames.Add(className))
|
||||
break;
|
||||
|
|
|
@ -344,7 +344,7 @@ namespace actorcompiler
|
|||
var actor = ParseActor(i, out end);
|
||||
if (classContextStack.Count > 0)
|
||||
{
|
||||
actor.enclosingClass = classContextStack.Peek().name;
|
||||
actor.enclosingClass = String.Join("::", classContextStack.Reverse().Select(t => t.name));
|
||||
}
|
||||
var actorWriter = new System.IO.StringWriter();
|
||||
actorWriter.NewLine = "\n";
|
||||
|
|
Loading…
Reference in New Issue