@@ -4096,6 +4096,7 @@ parseDeclTypeAlias(Parser::ParseDeclOptions Flags, DeclAttributes &Attributes) {
40964096 }
40974097
40984098 UnderlyingTy = parseType (diag::expected_type_in_typealias);
4099+ TAD->setTypeEndLoc (PreviousLoc);
40994100 Status |= UnderlyingTy;
41004101 }
41014102
@@ -4118,8 +4119,8 @@ parseDeclTypeAlias(Parser::ParseDeclOptions Flags, DeclAttributes &Attributes) {
41184119 if (EqualLoc.isInvalid ()) {
41194120 diagnose (Tok, diag::expected_equal_in_typealias);
41204121 Status.setIsParseError ();
4122+ return Status;
41214123 }
4122- return Status;
41234124 }
41244125
41254126 // Exit the scope introduced for the generic parameters.
@@ -4867,7 +4868,8 @@ Parser::parseDeclVarGetSet(Pattern *pattern, ParseDeclOptions Flags,
48674868 // If we have an invalid case, bail out now.
48684869 if (!PrimaryVar) {
48694870 fillInAccessorTypeErrors (*this , accessors);
4870- Decls.append (accessors.Accessors .begin (), accessors.Accessors .end ());
4871+ // Preserve the invariant that an accessor can be found from its VarDecl
4872+ accessors.record (*this , storage, Invalid, Decls);
48714873 return nullptr ;
48724874 }
48734875
@@ -6425,6 +6427,9 @@ Parser::parseDeclSubscript(SourceLoc StaticLoc,
64256427 accessors, Subscript, StaticLoc);
64266428 }
64276429
6430+ // Now that it's been parsed, set the end location.
6431+ Subscript->setEndLoc (PreviousLoc);
6432+
64286433 bool Invalid = false ;
64296434 // Reject 'subscript' functions outside of type decls
64306435 if (!(Flags & PD_HasContainerType)) {
0 commit comments