@@ -146,9 +146,6 @@ module ErrorMessages = struct
146146 " An inline record type declaration is only allowed in a variant \
147147 constructor's declaration"
148148
149- let sameTypeSpread =
150- " You're using a ... spread without extra fields. This is the same type."
151-
152149 let polyVarIntWithSuffix number =
153150 " A numeric polymorphic variant cannot be followed by a letter. Did you \
154151 mean `#" ^ number ^ " `?"
@@ -4094,19 +4091,10 @@ and parseRecordOrObjectType ~attrs p =
40944091 (Diagnostics. message ErrorMessages. forbiddenInlineRecordDeclaration)
40954092 | _ -> ()
40964093 in
4097- let startFirstField = p.startPos in
40984094 let fields =
40994095 parseCommaDelimitedRegion ~grammar: Grammar. StringFieldDeclarations
41004096 ~closing: Rbrace ~f: parseStringFieldDeclaration p
41014097 in
4102- let () =
4103- match fields with
4104- | [Parsetree. Oinherit {ptyp_loc}] ->
4105- (* {...x}, spread without extra fields *)
4106- Parser. err p ~start Pos:startFirstField ~end Pos:ptyp_loc.loc_end
4107- (Diagnostics. message ErrorMessages. sameTypeSpread)
4108- | _ -> ()
4109- in
41104098 Parser. expect Rbrace p;
41114099 let loc = mkLoc startPos p.prevEndPos in
41124100 Ast_helper.Typ. object_ ~loc ~attrs fields closedFlag
@@ -4566,8 +4554,6 @@ and parseConstrDeclArgs p =
45664554 match p.token with
45674555 | Rbrace ->
45684556 (* {...x}, spread without extra fields *)
4569- Parser. err ~start Pos:dotdotdotStart ~end Pos:dotdotdotEnd p
4570- (Diagnostics. message ErrorMessages. sameTypeSpread);
45714557 Parser. next p
45724558 | _ -> Parser. expect Comma p
45734559 in
@@ -4993,8 +4979,6 @@ and parseRecordOrObjectDecl p =
49934979 match p.token with
49944980 | Rbrace ->
49954981 (* {...x}, spread without extra fields *)
4996- Parser. err ~start Pos:dotdotdotStart ~end Pos:dotdotdotEnd p
4997- (Diagnostics. message ErrorMessages. sameTypeSpread);
49984982 Parser. next p
49994983 | _ -> Parser. expect Comma p
50004984 in
0 commit comments