1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-27 20:18:01 +02:00

Partial recursive generic fixes, deferred constraint type validation

This commit is contained in:
Brian Fiete 2021-02-16 14:53:48 -08:00
parent 3681b521b5
commit eb86c717f0
9 changed files with 162 additions and 53 deletions

View file

@ -1774,6 +1774,7 @@ public:
bool mInitializedGenericParams;
bool mFinishedGenericParams;
Array<BfProject*> mProjectsReferenced; // Generic methods that only refer to these projects don't need a specialized extension
int32 mMaxGenericDepth;
public:
BfGenericTypeInfo()
@ -1785,6 +1786,7 @@ public:
mValidatedGenericConstraints = false;
mInitializedGenericParams = false;
mFinishedGenericParams = false;
mMaxGenericDepth = -1;
}
~BfGenericTypeInfo();
@ -2525,10 +2527,12 @@ public:
static BfVariant EvaluateToVariant(LookupContext* ctx, BfExpression* expr, BfType*& outType);
static bool GenericTypeEquals(BfTypeInstance* lhsGenericType, BfTypeVector* lhsTypeGenericArguments, BfTypeReference* rhs, LookupContext* ctx, int& genericParamOffset);
static bool GenericTypeEquals(BfTypeInstance* lhsGenericType, BfTypeVector* typeGenericArguments, BfTypeReference* rhs, BfTypeDef* rhsTypeDef, LookupContext* ctx);
static void HashGenericArguments(BfTypeReference* typeRef, LookupContext* ctx, int& hash);
static int Hash(BfType* type, LookupContext* ctx, bool allowRef = false);
static int DirectHash(BfTypeReference* typeRef, LookupContext* ctx, BfHashFlags flags = BfHashFlag_None);
static int Hash(BfTypeReference* typeRef, LookupContext* ctx, BfHashFlags flags = BfHashFlag_None);
static void HashGenericArguments(BfTypeReference* typeRef, LookupContext* ctx, int& hash, int hashSeed);
static int DoHash(BfType* type, LookupContext* ctx, bool allowRef, int hashSeed);
static int Hash(BfType* type, LookupContext* ctx, bool allowRef = false, int hashSeed = 0);
static int DirectHash(BfTypeReference* typeRef, LookupContext* ctx, BfHashFlags flags = BfHashFlag_None, int hashSeed = 0);
static int DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHashFlags flags, int& hashSeed);
static int Hash(BfTypeReference* typeRef, LookupContext* ctx, BfHashFlags flags = BfHashFlag_None, int hashSeed = 0);
static bool Equals(BfType* lhs, BfType* rhs, LookupContext* ctx);
static bool Equals(BfType* lhs, BfTypeReference* rhs, LookupContext* ctx);
static bool Equals(BfType* lhs, BfTypeReference* rhs, BfTypeDef* rhsTypeDef, LookupContext* ctx);