mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Support interface binding with complex 'Self' returns ie: Result<Self>
This commit is contained in:
parent
b47f230345
commit
dc6f940561
3 changed files with 26 additions and 2 deletions
|
@ -5918,8 +5918,14 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
|
|||
continue;
|
||||
|
||||
auto iReturnType = ifaceMethodInst->mReturnType;
|
||||
if (iReturnType->IsSelf())
|
||||
iReturnType = typeInstance;
|
||||
if (iReturnType->IsUnspecializedTypeVariation())
|
||||
{
|
||||
BfType* resolvedType = ResolveGenericType(iReturnType, NULL, NULL);
|
||||
if (resolvedType != NULL)
|
||||
iReturnType = resolvedType;
|
||||
else
|
||||
iReturnType = typeInstance;
|
||||
}
|
||||
|
||||
if (ifaceMethodInst->mMethodDef->mIsOverride)
|
||||
continue; // Don't consider overrides here
|
||||
|
@ -7684,6 +7690,9 @@ BfType* BfModule::ResolveGenericType(BfType* unspecializedType, BfTypeVector* ty
|
|||
return unspecializedType;
|
||||
}
|
||||
|
||||
if ((unspecializedType->IsSelf()) && (mCurTypeInstance != NULL))
|
||||
return mCurTypeInstance;
|
||||
|
||||
if (!unspecializedType->IsUnspecializedType())
|
||||
{
|
||||
return unspecializedType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue