The implementation is not 100% perfect but I don’t think it’s worth putting too much effort into it passing more information down in the parser if 'repeat' and 'each' are valid if we are going to remove the current parser anyway.
rdar://95725895
Completing a generic parameter to a nested type `Outer.Nested<#^COMPLETE^#>` crashed when used to initialize a local variable and returned no results when initializing a global variable.
This is because the generic argument parsing logic for nested types inside `parseExprPostfixSuffix` didn’t match that of global types in `parseExprIdentifier`. Make sure they do the same thing semantically.
Fixes rdar://77909679 [SR-14627]
Due to https://github.com/apple/swift/pull/36552, parsing the code completion token as a type inside a generic parameter list no longer fails. Instead, it consumes the code completion token as a type identifier. However, since `parseExprIdentifer` does not return a `ParserStatus`, the information whether a code completion token was consumed gets lost, causing `setCodeCompletionDelayedDeclState` to not be called and thus no code completion results show up.
To resolve this, make `parseExprIdentifier` return its `ParserStatus` through a `ParserResult`.
Fixes rdar://76335452 [SR-14432]