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

Fixed constExprs with ints, hover for enum values, _ for enums

This commit is contained in:
Brian Fiete 2019-12-24 13:13:04 -08:00
parent 4087bf8e2a
commit 4dcd7f9c6a
21 changed files with 293 additions and 142 deletions

View file

@ -1404,11 +1404,8 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD
{
unresolvedType = ResolveTypeRef(varDecl->mTypeRef, BfPopulateType_Data, (BfResolveTypeRefFlags)(BfResolveTypeRefFlag_NoResolveGenericParam | BfResolveTypeRefFlag_AllowRef));
if (unresolvedType == NULL)
unresolvedType = mContext->mBfObjectType; // Fake an object
//resolvedType = ResolveGenericType(unresolvedType);
resolvedType = unresolvedType;
if (unresolvedType == NULL)
resolvedType = mContext->mBfObjectType; // Fake an object
unresolvedType = GetPrimitiveType(BfTypeCode_Var);
resolvedType = unresolvedType;
}
auto _CheckConst = [&]
@ -1417,7 +1414,7 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD
{
auto constant = mBfIRBuilder->GetConstant(initValue.mValue);
// NullPtr is standin for GlobalVar during autocomplete
// NullPtr is stand-in for GlobalVar during autocomplete
if ((constant->mConstType == BfConstType_GlobalVar) ||
(constant->mTypeCode == BfTypeCode_NullPtr))
{
@ -3114,7 +3111,7 @@ void BfModule::VisitCodeBlock(BfBlock* block)
if ((!autoComplete->mIsAutoComplete) ||
(autoComplete->mResolveType == BfResolveType_GetCurrentLocation) ||
(autoComplete->mResolveType == BfResolveType_GetFixits) ||
(autoComplete->mResolveType == BfResolveType_GetVarType) ||
(autoComplete->mResolveType == BfResolveType_GetResultString) ||
(autoComplete->mResolveType == BfResolveType_GetSymbolInfo) ||
(autoComplete->mResolveType == BfResolveType_ShowFileSymbolReferences))
wantsAllLocalMethods = false;