1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Static local methods and variables, fixed erroneous 'this' capture

This commit is contained in:
Brian Fiete 2022-02-11 10:38:57 -05:00
parent 3c74588e10
commit d9725dda7c
6 changed files with 97 additions and 13 deletions

View file

@ -175,12 +175,13 @@ public:
BfLocalVarAssignKind mAssignedKind;
bool mHadExitBeforeAssign;
bool mIsReadOnly;
bool mIsStatic;
bool mIsSplat;
bool mIsLowered;
bool mAllowAddr;
bool mIsShadow;
bool mUsedImplicitly; // Passed implicitly to a local method, capture by ref if we can
bool mNotCaptured;
bool mNotCaptured;
BfLocalVariable* mShadowedLocal;
public:
@ -204,6 +205,7 @@ public:
mWrittenToId = -1;
mReadFromId = -1;
mIsReadOnly = false;
mIsStatic = false;
mIsSplat = false;
mIsLowered = false;
mAllowAddr = false;
@ -1678,7 +1680,8 @@ public:
BfTypedValue GetCompilerFieldValue(const StringImpl& str);
BfTypedValue ReferenceStaticField(BfFieldInstance* fieldInstance);
int GetFieldDataIdx(BfTypeInstance* typeInst, int fieldIdx, const char* fieldName = NULL);
BfTypedValue GetThis();
BfTypedValue GetThis(bool markUsing = true);
void MarkUsingThis();
BfLocalVariable* GetThisVariable();
bool IsInGeneric();
bool InDefinitionSection();