- give PFunction a bit more information:

* explicitly require passing the owning class when creating it.
 * extract self pointer class when adding a variant.
 * put the flags on the single variants, we can not fully rule out that they will be 100% identical, if variants ever get allowed.
This commit is contained in:
Christoph Oelckers 2016-10-15 15:50:45 +02:00
commit db8ab1bc4a
10 changed files with 196 additions and 33 deletions

View file

@ -686,7 +686,7 @@ void FFunctionBuildList::Build()
// This needs to be fixed, so that the compile context receives the entire function symbol, including the containing class, the prototype and argument names, which will be needed to run the code generator
// As a first step this just needs to get working so fetch the class type from the prototype's argument list.
auto cls = static_cast<PClass*>(item.Func->Variants[0].Proto->ArgumentTypes[!!(item.Func->Flags & VARF_Action)]);
auto cls = static_cast<PClass*>(item.Func->Variants[0].Proto->ArgumentTypes[!!(item.Func->Variants[0].Flags & VARF_Action)]);
// We don't know the return type in advance for anonymous functions.
FCompileContext ctx(cls, nullptr);
item.Code = item.Code->Resolve(ctx);