Selaa lähdekoodia

Support for expression-bodied indexers

Brian Fiete 4 vuotta sitten
vanhempi
commit
ddad5bd492
1 muutettua tiedostoa jossa 8 lisäystä ja 6 poistoa
  1. 8 6
      IDEHelper/Compiler/BfReducer.cpp

+ 8 - 6
IDEHelper/Compiler/BfReducer.cpp

@@ -6724,9 +6724,6 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, int depth, BfAstNode* defe
 			mVisitorPos.MoveNext();
 
 			blockAfterIdx = mVisitorPos.mReadPos + 1;
-			auto block = ExpectBlockAfter(blockAfterPos);
-			if (block == NULL)
-				return indexerDeclaration;
 		}
 		else
 		{
@@ -6742,9 +6739,7 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, int depth, BfAstNode* defe
 		//  If we don't have a token afterwards then still treat it as a property for autocomplete purposes
 		if ((typeRef != NULL) &&
 			((block != NULL) || (tokenNode == NULL) || (isExprBodyProp)))
-		{
-			//mVisitorPos.mReadPos = blockAfterIdx;
-
+		{			
 			if (propertyDeclaration == NULL)
 			{
 				if ((block == NULL) && (!isExprBodyProp))
@@ -6820,6 +6815,13 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, int depth, BfAstNode* defe
 
 			return propertyDeclaration;
 		}
+		else if (propertyDeclaration != NULL)
+		{
+			// Failure case
+			block = ExpectBlockAfter(blockAfterPos);
+			BF_ASSERT(block == NULL);
+			return propertyDeclaration;
+		}
 
 		//nextNode = mVisitorPos.Get(mVisitorPos.mReadPos + 2);
 		/*if (tokenNode == NULL)