mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02: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);
|
int fileLoc = BfFixitFinder::FindLineStartBefore(refNode);
|
||||||
mCompiler->mResolvePassData->mAutoComplete->AddEntry(AutoCompleteEntry("fixit", StrFormat("#unwarn\tunwarn|%s|%d|#unwarn|", parser->mFileName.c_str(), fileLoc).c_str()));
|
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,12 +8434,15 @@ BfTypedValue BfModule::BoxValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
||||||
if (toType->IsBoxed())
|
if (toType->IsBoxed())
|
||||||
{
|
{
|
||||||
BfBoxedType* boxedType = (BfBoxedType*)toType;
|
BfBoxedType* boxedType = (BfBoxedType*)toType;
|
||||||
|
if (boxedType->mElementType->IsGenericParam())
|
||||||
|
{
|
||||||
if (typedVal.mType == boxedType->mElementType)
|
if (typedVal.mType == boxedType->mElementType)
|
||||||
return BfTypedValue(mBfIRBuilder->GetFakeVal(), toType);
|
return BfTypedValue(mBfIRBuilder->GetFakeVal(), toType);
|
||||||
else
|
else
|
||||||
return BfTypedValue();
|
return BfTypedValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BP_ZONE("BoxValue");
|
BP_ZONE("BoxValue");
|
||||||
|
|
||||||
|
|
|
@ -9167,7 +9167,8 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
||||||
doWrap = true;
|
doWrap = true;
|
||||||
}
|
}
|
||||||
if ((srcNode->IsA<BfCastExpression>()) ||
|
if ((srcNode->IsA<BfCastExpression>()) ||
|
||||||
(srcNode->IsA<BfBinaryOperatorExpression>()))
|
(srcNode->IsA<BfBinaryOperatorExpression>()) ||
|
||||||
|
(srcNode->IsA<BfConditionalExpression>()))
|
||||||
doWrap = true;
|
doWrap = true;
|
||||||
|
|
||||||
BfParserData* parser = srcNode->GetSourceData()->ToParserData();
|
BfParserData* parser = srcNode->GetSourceData()->ToParserData();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue