mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Improved some fixits, boxing fix
This commit is contained in:
parent
d6566982f2
commit
36bf9df1f5
2 changed files with 17 additions and 7 deletions
|
@ -2709,6 +2709,12 @@ BfError* BfModule::Warn(int warningNum, const StringImpl& warning, BfAstNode* re
|
|||
{
|
||||
int fileLoc = BfFixitFinder::FindLineStartBefore(refNode);
|
||||
mCompiler->mResolvePassData->mAutoComplete->AddEntry(AutoCompleteEntry("fixit", StrFormat("#unwarn\tunwarn|%s|%d|#unwarn|", parser->mFileName.c_str(), fileLoc).c_str()));
|
||||
|
||||
if (warningNum != 0)
|
||||
{
|
||||
mCompiler->mResolvePassData->mAutoComplete->AddEntry(AutoCompleteEntry("fixit", StrFormat("#pragma warning disable %d\tusing|%s|%d||#pragma warning disable %d",
|
||||
warningNum, parser->mFileName.c_str(), 0, warningNum).c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8428,10 +8434,13 @@ BfTypedValue BfModule::BoxValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
|||
if (toType->IsBoxed())
|
||||
{
|
||||
BfBoxedType* boxedType = (BfBoxedType*)toType;
|
||||
if (typedVal.mType == boxedType->mElementType)
|
||||
return BfTypedValue(mBfIRBuilder->GetFakeVal(), toType);
|
||||
else
|
||||
return BfTypedValue();
|
||||
if (boxedType->mElementType->IsGenericParam())
|
||||
{
|
||||
if (typedVal.mType == boxedType->mElementType)
|
||||
return BfTypedValue(mBfIRBuilder->GetFakeVal(), toType);
|
||||
else
|
||||
return BfTypedValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9167,7 +9167,8 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
|||
doWrap = true;
|
||||
}
|
||||
if ((srcNode->IsA<BfCastExpression>()) ||
|
||||
(srcNode->IsA<BfBinaryOperatorExpression>()))
|
||||
(srcNode->IsA<BfBinaryOperatorExpression>()) ||
|
||||
(srcNode->IsA<BfConditionalExpression>()))
|
||||
doWrap = true;
|
||||
|
||||
BfParserData* parser = srcNode->GetSourceData()->ToParserData();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue