diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index ab8375ab..5e3e2693 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -3114,8 +3114,8 @@ BfTypedValue BfExprEvaluator::LookupIdentifier(BfAstNode* refNode, const StringI } } - if (!thisValue) - thisValue = BfTypedValue(mModule->mCurTypeInstance); + if (!thisValue.HasType()) + thisValue = BfTypedValue(mModule->mCurTypeInstance); BfTypedValue result = LookupField(identifierNode, thisValue, findName, BfLookupFieldFlag_IsImplicitThis); if (mPropDef != NULL) { diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 6d56d29b..92d9b363 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -12062,7 +12062,7 @@ BfTypedValue BfModule::GetThis() if (checkMethodState->mMixinState != NULL) { BfTypedValue thisValue = checkMethodState->mMixinState->mTarget; - if (thisValue) + if (thisValue.HasType()) { checkMethodState->mMixinState->mLastTargetAccessId = useMethodState->GetRootMethodState()->mCurAccessId++; if (!thisValue.mType->IsValueType()) diff --git a/IDEHelper/Tests/src/Mixins.bf b/IDEHelper/Tests/src/Mixins.bf index 6cc79f83..7bff5aa3 100644 --- a/IDEHelper/Tests/src/Mixins.bf +++ b/IDEHelper/Tests/src/Mixins.bf @@ -7,6 +7,7 @@ namespace Tests class MixClass { public int mA = 100; + public static int sA = 200; public mixin MixA(var addTo) { @@ -22,6 +23,11 @@ namespace Tests AddIt(); } + + public static mixin MixC(var val) + { + val + sA + } } [Test] @@ -32,6 +38,7 @@ namespace Tests Test.Assert(mc.mA == 110); mc.MixB!(10); Test.Assert(mc.mA == 120); + Test.Assert(MixClass.MixC!(30) == 230); } [Test]