Fixed consistency of checks

This commit is contained in:
ZZYZX 2017-02-17 18:01:39 +02:00
parent 4fe9c7d8c8
commit 2b20abff02

View file

@ -2415,7 +2415,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
Error(f, "Attempt to change scope for virtual function %s", FName(f->Name).GetChars()); Error(f, "Attempt to change scope for virtual function %s", FName(f->Name).GetChars());
} }
// you can't change const qualifier for a virtual method // you can't change const qualifier for a virtual method
if (oldfunc->FuncConst != (varflags & VARF_ReadOnly)) if (oldfunc->FuncConst != sym->Variants[0].Implementation->FuncConst)
{ {
Error(f, "Attempt to change const qualifier for virtual function %s", FName(f->Name).GetChars()); Error(f, "Attempt to change const qualifier for virtual function %s", FName(f->Name).GetChars());
} }