mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02:21 +02:00
Const actualization fixes
This commit is contained in:
parent
870c9914be
commit
a7da8a75d6
3 changed files with 22 additions and 2 deletions
|
@ -234,7 +234,10 @@ BfTypedValue BfConstResolver::Resolve(BfExpression* expr, BfType* wantType, BfCo
|
||||||
mModule->FixIntUnknown(mResult);
|
mModule->FixIntUnknown(mResult);
|
||||||
|
|
||||||
if ((flags & BfConstResolveFlag_NoActualizeValues) == 0)
|
if ((flags & BfConstResolveFlag_NoActualizeValues) == 0)
|
||||||
|
{
|
||||||
|
prevIgnoreWrites.Restore();
|
||||||
mModule->FixValueActualization(mResult, !prevIgnoreWrites.mPrevVal || ((flags & BfConstResolveFlag_ActualizeValues) != 0));
|
mModule->FixValueActualization(mResult, !prevIgnoreWrites.mPrevVal || ((flags & BfConstResolveFlag_ActualizeValues) != 0));
|
||||||
|
}
|
||||||
|
|
||||||
return mResult;
|
return mResult;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8499,7 +8499,8 @@ BfType* BfModule::ResolveTypeResult(BfTypeReference* typeRef, BfType* resolvedTy
|
||||||
|
|
||||||
populateModule->PopulateType(resolvedTypeRef, populateType);
|
populateModule->PopulateType(resolvedTypeRef, populateType);
|
||||||
|
|
||||||
if ((typeInstance != NULL) && (typeInstance->mTypeDef != NULL) && (typeInstance->mTypeDef->mProtection == BfProtection_Internal) && (typeInstance->mTypeDef->mOuterType == NULL))
|
if ((typeInstance != NULL) && (typeInstance->mTypeDef != NULL) && (typeInstance->mTypeDef->mProtection == BfProtection_Internal) &&
|
||||||
|
(typeInstance->mTypeDef->mOuterType == NULL) && (!typeRef->IsTemporary()))
|
||||||
{
|
{
|
||||||
if (!CheckProtection(typeInstance->mTypeDef->mProtection, typeInstance->mTypeDef, false, false))
|
if (!CheckProtection(typeInstance->mTypeDef->mProtection, typeInstance->mTypeDef, false, false))
|
||||||
Fail(StrFormat("'%s' is inaccessible due to its protection level", TypeToString(typeInstance).c_str()), typeRef); // CS0122
|
Fail(StrFormat("'%s' is inaccessible due to its protection level", TypeToString(typeInstance).c_str()), typeRef); // CS0122
|
||||||
|
|
16
IDEHelper/Tests/src/Reflection2.bf
Normal file
16
IDEHelper/Tests/src/Reflection2.bf
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#pragma warning disable 168
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Tests
|
||||||
|
{
|
||||||
|
class Reflection2
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public static void TestBasics()
|
||||||
|
{
|
||||||
|
const Type t = typeof(StringView);
|
||||||
|
int fieldCount = t.FieldCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue