mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed auto-prop issues
This commit is contained in:
parent
a17f8961b0
commit
6ae5d2e7aa
3 changed files with 39 additions and 47 deletions
|
@ -1382,7 +1382,7 @@ void BfAutoComplete::CheckIdentifier(BfIdentifierNode* identifierNode, bool isIn
|
|||
"delegate", "delete", "do", "else", "false", "finally",
|
||||
"fixed", "for", "function", "if", "implicit", "in", "internal", "is", "new", "mixin", "null",
|
||||
"out", "params", "ref", "rettype", "return",
|
||||
"sealed", "sizeof", "scope", "static", "strideof", "struct", "switch", /*"this",*/ "throw", "try", "true", "typeof", "unchecked",
|
||||
"sealed", "sizeof", "scope", "static", "strideof", "struct", "switch", /*"this",*/ "try", "true", "typeof", "unchecked",
|
||||
"using", "var", "virtual", "volatile", "where", "while",
|
||||
};
|
||||
|
||||
|
|
|
@ -14227,11 +14227,6 @@ void BfModule::SetupIRMethod(BfMethodInstance* methodInstance, BfIRFunction func
|
|||
argIdx++;
|
||||
}
|
||||
|
||||
if (methodDef->mName == "Hello")
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
while (argIdx < argCount)
|
||||
{
|
||||
while ((paramIdx != -1) && (methodInstance->IsParamSkipped(paramIdx)))
|
||||
|
@ -15143,11 +15138,6 @@ void BfModule::EmitGCMarkValue(BfTypedValue markVal, BfModuleMethodInstance mark
|
|||
if (markVal.mType != methodOwner)
|
||||
markVal = Cast(NULL, markVal, methodOwner);
|
||||
|
||||
if (markMemberMethodInstance.mMethodInstance->mIdHash == 0x1500000236LL)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
exprEvaluator.PushThis(NULL, markVal, markMemberMethodInstance.mMethodInstance, args);
|
||||
exprEvaluator.CreateCall(markMemberMethodInstance.mMethodInstance, markMemberMethodInstance.mFunc, false, args);
|
||||
}
|
||||
|
@ -17427,33 +17417,7 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup)
|
|||
skipBody = true;
|
||||
skipEndChecks = true;
|
||||
}
|
||||
else if (HasCompiledOutput())
|
||||
{
|
||||
if ((methodDef->mName == BF_METHODNAME_MARKMEMBERS) || (methodDef->mName == BF_METHODNAME_MARKMEMBERS_STATIC))
|
||||
{
|
||||
if (mCompiler->mOptions.mEnableRealtimeLeakCheck)
|
||||
{
|
||||
EmitGCMarkMembers();
|
||||
}
|
||||
else if (!mCurTypeInstance->IsObject())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else if (methodDef->mName == BF_METHODNAME_FIND_TLS_MEMBERS)
|
||||
{
|
||||
if (mCompiler->mOptions.mEnableRealtimeLeakCheck)
|
||||
{
|
||||
EmitGCFindTLSMembers();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!skipBody)
|
||||
{
|
||||
bool isEmptyBodied = BfNodeDynCast<BfTokenNode>(methodDef->mBody) != NULL;
|
||||
|
||||
if (isEmptyBodied) // Generate autoProperty things
|
||||
else
|
||||
{
|
||||
auto propertyDeclaration = methodDef->GetPropertyDeclaration();
|
||||
if ((propertyDeclaration != NULL) && (!typeDef->HasAutoProperty(propertyDeclaration)))
|
||||
|
@ -17509,7 +17473,11 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup)
|
|||
}
|
||||
else if (methodDef->mMethodType == BfMethodType_PropertySetter)
|
||||
{
|
||||
if (!mCompiler->IsAutocomplete())
|
||||
if (!methodDef->mIsMutating)
|
||||
{
|
||||
Fail("Auto-setter must be marked as 'mut'", methodDef->GetRefNode(), true);
|
||||
}
|
||||
else if (!mCompiler->IsAutocomplete())
|
||||
{
|
||||
String autoPropName = typeDef->GetAutoPropertyName(propertyDeclaration);
|
||||
BfFieldInstance* fieldInstance = GetFieldByName(mCurTypeInstance, autoPropName);
|
||||
|
@ -17545,7 +17513,31 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ((methodDef->mName == BF_METHODNAME_MARKMEMBERS) || (methodDef->mName == BF_METHODNAME_MARKMEMBERS_STATIC))
|
||||
{
|
||||
if (mCompiler->mOptions.mEnableRealtimeLeakCheck)
|
||||
{
|
||||
if (HasCompiledOutput())
|
||||
EmitGCMarkMembers();
|
||||
}
|
||||
else if (!mCurTypeInstance->IsObject())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else if (methodDef->mName == BF_METHODNAME_FIND_TLS_MEMBERS)
|
||||
{
|
||||
if (mCompiler->mOptions.mEnableRealtimeLeakCheck)
|
||||
{
|
||||
if (HasCompiledOutput())
|
||||
EmitGCFindTLSMembers();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!skipBody)
|
||||
{
|
||||
bool isEmptyBodied = BfNodeDynCast<BfTokenNode>(methodDef->mBody) != NULL;
|
||||
|
||||
if ((!mCurMethodInstance->mReturnType->IsValuelessType()) && (!isEmptyBodied))
|
||||
{
|
||||
|
|
|
@ -790,7 +790,7 @@ bool BfTypeDef::HasAutoProperty(BfPropertyDeclaration* propertyDeclaration)
|
|||
|
||||
for (auto methodDeclaration : propertyDeclaration->mMethods)
|
||||
{
|
||||
if (BfNodeDynCast<BfTokenNode>(methodDeclaration->mBody) != NULL)
|
||||
if (methodDeclaration->mBody == NULL)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue