@@ -146,9 +146,6 @@ module ErrorMessages = struct
146
146
" An inline record type declaration is only allowed in a variant \
147
147
constructor's declaration"
148
148
149
- let sameTypeSpread =
150
- " You're using a ... spread without extra fields. This is the same type."
151
-
152
149
let polyVarIntWithSuffix number =
153
150
" A numeric polymorphic variant cannot be followed by a letter. Did you \
154
151
mean `#" ^ number ^ " `?"
@@ -4094,19 +4091,10 @@ and parseRecordOrObjectType ~attrs p =
4094
4091
(Diagnostics. message ErrorMessages. forbiddenInlineRecordDeclaration)
4095
4092
| _ -> ()
4096
4093
in
4097
- let startFirstField = p.startPos in
4098
4094
let fields =
4099
4095
parseCommaDelimitedRegion ~grammar: Grammar. StringFieldDeclarations
4100
4096
~closing: Rbrace ~f: parseStringFieldDeclaration p
4101
4097
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
4110
4098
Parser. expect Rbrace p;
4111
4099
let loc = mkLoc startPos p.prevEndPos in
4112
4100
Ast_helper.Typ. object_ ~loc ~attrs fields closedFlag
@@ -4566,8 +4554,6 @@ and parseConstrDeclArgs p =
4566
4554
match p.token with
4567
4555
| Rbrace ->
4568
4556
(* {...x}, spread without extra fields *)
4569
- Parser. err ~start Pos:dotdotdotStart ~end Pos:dotdotdotEnd p
4570
- (Diagnostics. message ErrorMessages. sameTypeSpread);
4571
4557
Parser. next p
4572
4558
| _ -> Parser. expect Comma p
4573
4559
in
@@ -4993,8 +4979,6 @@ and parseRecordOrObjectDecl p =
4993
4979
match p.token with
4994
4980
| Rbrace ->
4995
4981
(* {...x}, spread without extra fields *)
4996
- Parser. err ~start Pos:dotdotdotStart ~end Pos:dotdotdotEnd p
4997
- (Diagnostics. message ErrorMessages. sameTypeSpread);
4998
4982
Parser. next p
4999
4983
| _ -> Parser. expect Comma p
5000
4984
in
0 commit comments