1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed mixins parameter mutability with splattables

This commit is contained in:
Brian Fiete 2020-12-26 07:36:26 -08:00
parent 00b8bb59a7
commit ff6c7c5b90
3 changed files with 4 additions and 1 deletions

View file

@ -586,6 +586,7 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
if (methodDeclaration->mNameNode != NULL) if (methodDeclaration->mNameNode != NULL)
methodDef->mName = methodDeclaration->mNameNode->ToString(); methodDef->mName = methodDeclaration->mNameNode->ToString();
methodDef->mMethodType = BfMethodType_Mixin; methodDef->mMethodType = BfMethodType_Mixin;
methodDef->mIsNoSplat = true;
} }
else else
{ {

View file

@ -16848,7 +16848,7 @@ void BfModule::ProcessMethod_SetupParams(BfMethodInstance* methodInstance, BfTyp
{ {
paramVar->mIsSplat = true; paramVar->mIsSplat = true;
} }
else if (resolvedType->IsComposite() && resolvedType->IsSplattable()) else if ((resolvedType->IsComposite()) && (resolvedType->IsSplattable()))
{ {
if ((!mIsConstModule) && (methodInstance->AllowsSplatting())) if ((!mIsConstModule) && (methodInstance->AllowsSplatting()))
{ {

View file

@ -2479,6 +2479,8 @@ BfFieldDef* BfTupleType::AddField(const StringImpl& name)
void BfTupleType::Finish() void BfTupleType::Finish()
{ {
BF_ASSERT(!mTypeFailed);
auto bfSystem = mTypeDef->mSystem; auto bfSystem = mTypeDef->mSystem;
mSource = new BfSource(bfSystem); mSource = new BfSource(bfSystem);
mTypeDef->mSource = mSource; mTypeDef->mSource = mSource;