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:
parent
7244150dae
commit
935d5bd340
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue