| 3703 | } |
| 3704 | |
| 3705 | bool BfModule::CheckDefineMemberProtection(BfProtection protection, BfType* memberType) |
| 3706 | { |
| 3707 | // Use 'min' - exporting a 'public' from a 'private' class is really just 'private' still |
| 3708 | protection = std::min(protection, mCurTypeInstance->mTypeDef->mProtection); |
| 3709 | |
| 3710 | auto memberTypeInstance = memberType->ToTypeInstance(); |
| 3711 | |
| 3712 | if (memberTypeInstance == NULL) |
| 3713 | { |
| 3714 | auto underlyingType = memberType->GetUnderlyingType(); |
| 3715 | if (underlyingType != NULL) |
| 3716 | return CheckDefineMemberProtection(protection, underlyingType); |
| 3717 | return true; |
| 3718 | } |
| 3719 | |
| 3720 | if (memberTypeInstance->mTypeDef->mProtection < protection) |
| 3721 | return false; |
| 3722 | |
| 3723 | if (memberTypeInstance->IsGenericTypeInstance()) |
| 3724 | { |
| 3725 | // When we're a generic struct, our data layout can depend on our generic parameters as well |
| 3726 | auto genericTypeInstance = (BfTypeInstance*) memberTypeInstance; |
| 3727 | for (auto typeGenericArg : genericTypeInstance->mGenericTypeInfo->mTypeGenericArguments) |
| 3728 | { |
| 3729 | if (!CheckDefineMemberProtection(protection, typeGenericArg)) |
| 3730 | return false; |
| 3731 | } |
| 3732 | } |
| 3733 | |
| 3734 | return true; |
| 3735 | } |
| 3736 | |
| 3737 | void BfModule::AddDependency(BfType* usedType, BfType* userType, BfDependencyMap::DependencyFlags flags, BfDepContext* depContext) |
| 3738 | { |
nothing calls this directly
no test coverage detected