mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Improved constraint checks where generic param type constraint passes
This commit is contained in:
parent
116d9c6f01
commit
b7725d0ed0
4 changed files with 76 additions and 1 deletions
|
@ -9861,6 +9861,16 @@ BfGenericParamInstance* BfModule::GetGenericParamInstance(BfGenericParamType* ty
|
|||
return GetGenericTypeParamInstance(type->mGenericParamIdx, failHandleKind);
|
||||
}
|
||||
|
||||
BfType* BfModule::GetGenericParamInstanceTypeConstraint(BfType* type, bool checkMixinBind, BfFailHandleKind failHandleKind)
|
||||
{
|
||||
if (!type->IsGenericParam())
|
||||
return NULL;
|
||||
auto genericParamInstance = GetGenericParamInstance((BfGenericParamType*)type, checkMixinBind, failHandleKind);
|
||||
if (genericParamInstance != NULL)
|
||||
return genericParamInstance->mTypeConstraint;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool BfModule::ResolveTypeResult_Validate(BfAstNode* typeRef, BfType* resolvedTypeRef)
|
||||
{
|
||||
if ((typeRef == NULL) || (resolvedTypeRef == NULL))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue