mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Allow implicit cast from function to void*
This commit is contained in:
parent
8d934192c0
commit
4ecd7861d6
1 changed files with 6 additions and 6 deletions
|
@ -9560,14 +9560,14 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
|||
return mBfIRBuilder->CreateBitCast(typedVal.mValue, mBfIRBuilder->MapType(toType));
|
||||
}
|
||||
|
||||
if (explicitCast)
|
||||
{
|
||||
// Func -> void*
|
||||
if ((typedVal.mType->IsFunction()) && (toType->IsVoidPtr()))
|
||||
{
|
||||
return mBfIRBuilder->CreateIntToPtr(typedVal.mValue, mBfIRBuilder->MapType(toType));
|
||||
}
|
||||
|
||||
if (explicitCast)
|
||||
{
|
||||
// void* -> Func
|
||||
if ((typedVal.mType->IsVoidPtr()) && (toType->IsFunction()))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue