- declared most native getters in Actor as const.
- made the self pointer of const functions readonly. This seems to work fine. Both calling a non-const function and trying to assign a value to a member fail with an error message.
This commit is contained in:
parent
4c5794b6d5
commit
7dbc6939c4
3 changed files with 31 additions and 21 deletions
|
|
@ -2156,6 +2156,15 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
|
|||
}
|
||||
if (f->Flags & ZCC_Action)
|
||||
{
|
||||
if (varflags & VARF_ReadOnly)
|
||||
{
|
||||
Error(f, "Action functions cannot be declared const");
|
||||
varflags &= ~VARF_ReadOnly;
|
||||
}
|
||||
if (varflags & VARF_UI)
|
||||
{
|
||||
Error(f, "Action functions cannot be declared UI");
|
||||
}
|
||||
// Non-Actors cannot have action functions.
|
||||
if (!c->Type()->IsKindOf(RUNTIME_CLASS(PClassActor)))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue