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

Improved handling of opaque types

This commit is contained in:
Brian Fiete 2025-01-14 11:45:44 -08:00
parent f96e231d7b
commit 16371ab07c
3 changed files with 37 additions and 26 deletions

View file

@ -5475,7 +5475,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
{
auto resolvedFieldType = fieldInstance->GetResolvedType();
if ((!typeInstance->IsBoxed()) && (fieldDef != NULL))
{
{
if (fieldDef->mUsingProtection != BfProtection_Hidden)
{
auto fieldDecl = fieldDef->GetFieldDeclaration();
@ -5743,6 +5743,11 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
}
}
if ((resolvedFieldType->IsOpaque()) && (!IsInSpecializedGeneric()))
Fail(StrFormat("Invalid use of opaque type '%s' in field '%s.%s'",
TypeToString(resolvedFieldType).c_str(), TypeToString(mCurTypeInstance).c_str(), fieldDef->mName.c_str()),
fieldDef->mTypeRef, true);
if ((!typeInstance->IsSpecializedType()) && (!typeInstance->IsOnDemand()) && (fieldDef != NULL) && (!CheckDefineMemberProtection(fieldDef->mProtection, resolvedFieldType)))
{
//CS0052