1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Allow null conditional on generic param without warning

This commit is contained in:
Brian Fiete 2022-07-10 16:58:34 -04:00
parent 7244150dae
commit 935d5bd340

View file

@ -21209,6 +21209,11 @@ BfTypedValue BfExprEvaluator::SetupNullConditional(BfTypedValue thisValue, BfTok
}
else
{
bool canBeNull = false;
if (thisValue.mType->IsGenericParam())
canBeNull = true;
if (!canBeNull)
mModule->Warn(0, StrFormat("Null conditional reference is unnecessary since value type '%s' can never be null", mModule->TypeToString(thisValue.mType).c_str()), dotToken);
return thisValue;
}