mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 08:58:00 +02:00
Fixed default base ctor issues
This commit is contained in:
parent
c48c292f78
commit
e6344c02b1
2 changed files with 21 additions and 14 deletions
|
@ -5176,7 +5176,22 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
|
|||
if ((autoComplete != NULL) && (prevNode != NULL))
|
||||
autoComplete->CheckEmptyStart(prevNode, wantType);
|
||||
|
||||
BfError* error = mModule->Fail(StrFormat("Not enough parameters specified, expected %d more.", methodInstance->GetParamCount() - paramIdx), refNode);
|
||||
BfError* error = NULL;
|
||||
|
||||
if (mModule->mParentNodeEntry != NULL)
|
||||
{
|
||||
if (auto ctorDeclaration = BfNodeDynCast<BfConstructorDeclaration>(mModule->mParentNodeEntry->mNode))
|
||||
{
|
||||
if (ctorDeclaration->mInitializer == NULL)
|
||||
{
|
||||
error = mModule->Fail(StrFormat("No parameterless constructor is available for base class. Consider calling base constructor '%s'.",
|
||||
mModule->MethodToString(methodInstance).c_str()), refNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (error != NULL)
|
||||
error = mModule->Fail(StrFormat("Not enough parameters specified, expected %d more.", methodInstance->GetParamCount() - paramIdx), refNode);
|
||||
if ((error != NULL) && (methodInstance->mMethodDef->mMethodDeclaration != NULL))
|
||||
mModule->mCompiler->mPassInstance->MoreInfo(StrFormat("See method declaration"), methodInstance->mMethodDef->GetRefNode());
|
||||
failed = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue