mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed boxing in cast in ternary expression
This commit is contained in:
parent
39595bf387
commit
a23406d9dd
2 changed files with 6 additions and 2 deletions
|
@ -19742,8 +19742,6 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr)
|
||||||
mModule->FixIntUnknown(falseValue);
|
mModule->FixIntUnknown(falseValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
prevInCondBlock.Restore();
|
|
||||||
|
|
||||||
bool isValid = trueValue && falseValue;
|
bool isValid = trueValue && falseValue;
|
||||||
|
|
||||||
if (isValid)
|
if (isValid)
|
||||||
|
@ -19780,6 +19778,8 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prevInCondBlock.Restore();
|
||||||
|
|
||||||
mModule->mBfIRBuilder->SetInsertPoint(trueBlockPos);
|
mModule->mBfIRBuilder->SetInsertPoint(trueBlockPos);
|
||||||
if (isValid)
|
if (isValid)
|
||||||
trueValue = mModule->LoadValue(trueValue);
|
trueValue = mModule->LoadValue(trueValue);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma warning disable 168
|
#pragma warning disable 168
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
namespace Tests
|
namespace Tests
|
||||||
{
|
{
|
||||||
|
@ -86,6 +87,9 @@ namespace Tests
|
||||||
var scObjResult = scVariant.GetBoxed();
|
var scObjResult = scVariant.GetBoxed();
|
||||||
Test.Assert(scObjResult case .Err);
|
Test.Assert(scObjResult case .Err);
|
||||||
scVariant.Dispose();
|
scVariant.Dispose();
|
||||||
|
|
||||||
|
List<int> l = scope .();
|
||||||
|
IEnumerator<int> e = (l != null) ? (.)null : l.GetEnumerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue