mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed issue with non-static mixin usage inside a lambda
This commit is contained in:
parent
a4c9b4f3c4
commit
fb23269e33
2 changed files with 13 additions and 1 deletions
|
@ -13032,7 +13032,8 @@ BfTypedValue BfModule::ReferenceStaticField(BfFieldInstance* fieldInstance)
|
||||||
BfTypedValue BfModule::GetThis()
|
BfTypedValue BfModule::GetThis()
|
||||||
{
|
{
|
||||||
auto useMethodState = mCurMethodState;
|
auto useMethodState = mCurMethodState;
|
||||||
while ((useMethodState != NULL) && (useMethodState->mClosureState != NULL) && (useMethodState->mClosureState->mCapturing))
|
while ((useMethodState != NULL) && (useMethodState->mClosureState != NULL) && (useMethodState->mClosureState->mCapturing) &&
|
||||||
|
(useMethodState->mMixinState == NULL))
|
||||||
{
|
{
|
||||||
useMethodState = useMethodState->mPrevMethodState;
|
useMethodState = useMethodState->mPrevMethodState;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,17 @@ namespace Tests
|
||||||
Test.Assert(val1 == 123);
|
Test.Assert(val1 == 123);
|
||||||
GetVal2!(var val2);
|
GetVal2!(var val2);
|
||||||
Test.Assert(val2 == 234);
|
Test.Assert(val2 == 234);
|
||||||
|
|
||||||
|
void CheckStr(char8* cStr)
|
||||||
|
{
|
||||||
|
Test.Assert(StringView(cStr) == "Test");
|
||||||
|
}
|
||||||
|
|
||||||
|
function void(StringView sv) func = (sv) =>
|
||||||
|
{
|
||||||
|
CheckStr(sv.ToScopeCStr!());
|
||||||
|
};
|
||||||
|
func("Test");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue