mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Improved param defaults, allowing for implicit cast operators
This commit is contained in:
parent
ea072ad77b
commit
5bbffe268b
6 changed files with 98 additions and 32 deletions
|
@ -984,7 +984,12 @@ void BfCompiler::EmitTestMethod(BfVDataModule* bfModule, Array<TestMethod>& test
|
|||
{
|
||||
for (int defaultIdx = 0; defaultIdx < (int)methodInstance->mDefaultValues.size(); defaultIdx++)
|
||||
{
|
||||
irArgs.Add(methodInstance->mDefaultValues[defaultIdx]);
|
||||
auto castedVal = bfModule->Cast(methodInstance->mMethodDef->GetRefNode(), methodInstance->mDefaultValues[defaultIdx], methodInstance->GetParamType(defaultIdx));
|
||||
if (castedVal)
|
||||
{
|
||||
BfExprEvaluator exprEvaluator(bfModule);
|
||||
exprEvaluator.PushArg(castedVal, irArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue