mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed erroneous return type limitations for operators
This commit is contained in:
parent
5cc6f13af4
commit
ecdc22920a
3 changed files with 4 additions and 7 deletions
|
@ -1623,7 +1623,7 @@ void BfAutoComplete::CheckIdentifier(BfAstNode* identifierNode, bool isInExpress
|
||||||
{
|
{
|
||||||
"abstract", "base", "class", "const",
|
"abstract", "base", "class", "const",
|
||||||
"delegate", "extern", "enum", "explicit", "extension", "function",
|
"delegate", "extern", "enum", "explicit", "extension", "function",
|
||||||
"interface", "in", "internal", "mixin", "namespace", "new",
|
"interface", "in", "implicit", "internal", "mixin", "namespace", "new",
|
||||||
"operator", "out", "override", "params", "private", "protected", "public", "readonly", "ref", "rettype", "return",
|
"operator", "out", "override", "params", "private", "protected", "public", "readonly", "ref", "rettype", "return",
|
||||||
"scope", "sealed", "static", "struct", "this", "typealias",
|
"scope", "sealed", "static", "struct", "this", "typealias",
|
||||||
"using", "virtual", "volatile", "T", "where"
|
"using", "virtual", "volatile", "T", "where"
|
||||||
|
|
|
@ -14491,7 +14491,7 @@ BfLocalVariable* BfModule::AddLocalVariableDef(BfLocalVariable* localVarDef, boo
|
||||||
if ((localVarDef->mNameNode != NULL) && (mCurMethodInstance != NULL))
|
if ((localVarDef->mNameNode != NULL) && (mCurMethodInstance != NULL))
|
||||||
{
|
{
|
||||||
bool isClosureProcessing = (mCurMethodState->mClosureState != NULL) && (!mCurMethodState->mClosureState->mCapturing);
|
bool isClosureProcessing = (mCurMethodState->mClosureState != NULL) && (!mCurMethodState->mClosureState->mCapturing);
|
||||||
if ((!isClosureProcessing) && (mCompiler->mResolvePassData != NULL) && (localVarDef->mNameNode != NULL) && (!mIsComptimeModule))
|
if ((!isClosureProcessing) && (mCompiler->mResolvePassData != NULL) && (localVarDef->mNameNode != NULL) && (rootMethodState->mMethodInstance != NULL) && (!mIsComptimeModule))
|
||||||
mCompiler->mResolvePassData->HandleLocalReference(localVarDef->mNameNode, rootMethodState->mMethodInstance->GetOwner()->mTypeDef, rootMethodState->mMethodInstance->mMethodDef, localVarDef->mLocalVarId);
|
mCompiler->mResolvePassData->HandleLocalReference(localVarDef->mNameNode, rootMethodState->mMethodInstance->GetOwner()->mTypeDef, rootMethodState->mMethodInstance->mMethodDef, localVarDef->mLocalVarId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5912,12 +5912,9 @@ BfAstNode* BfReducer::ReadTypeMember(BfTokenNode* tokenNode, bool declStarted, i
|
||||||
ReplaceNode(tokenNode, operatorDecl);
|
ReplaceNode(tokenNode, operatorDecl);
|
||||||
operatorDecl->mOperatorToken = tokenNode;
|
operatorDecl->mOperatorToken = tokenNode;
|
||||||
|
|
||||||
auto nextIdentifier = ExpectIdentifierAfter(operatorDecl, "type");
|
|
||||||
if (nextIdentifier == NULL)
|
|
||||||
return operatorDecl;
|
|
||||||
mVisitorPos.mReadPos--; // Backtrack, that's part of our type
|
|
||||||
|
|
||||||
auto typeRef = CreateTypeRefAfter(operatorDecl);
|
auto typeRef = CreateTypeRefAfter(operatorDecl);
|
||||||
|
if (typeRef == NULL)
|
||||||
|
return operatorDecl;
|
||||||
MEMBER_SET_CHECKED(operatorDecl, mReturnType, typeRef);
|
MEMBER_SET_CHECKED(operatorDecl, mReturnType, typeRef);
|
||||||
operatorDecl->mIsConvOperator = true;
|
operatorDecl->mIsConvOperator = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue