@@ -4144,8 +4144,16 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
41444144 }
41454145 // The fun or constructor has no field map and so we error
41464146 // if arguments have been labelled.
4147- Ok ( None ) if fun. is_record_constructor_function ( ) => assert_no_labelled_arguments ( & arguments, UnexpectedLabelledArgKind :: RecordConstructorArgument ) ,
4148- Ok ( None ) => assert_no_labelled_arguments ( & arguments, UnexpectedLabelledArgKind :: FunctionParameter ) ,
4147+ Ok ( None ) if fun. is_record_constructor_function ( ) => {
4148+ assert_no_labelled_arguments (
4149+ & arguments,
4150+ UnexpectedLabelledArgKind :: RecordConstructorArgument ,
4151+ )
4152+ }
4153+ Ok ( None ) => assert_no_labelled_arguments (
4154+ & arguments,
4155+ UnexpectedLabelledArgKind :: FunctionParameter ,
4156+ ) ,
41494157 } ;
41504158
41514159 // If there's an error reordering the fields, or there's labelled
@@ -4542,8 +4550,14 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
45424550 // known to be a valid function we can make sure that there's
45434551 // no labelled arguments if it doesn't actually have a field map.
45444552 None if fun. is_invalid ( ) => Ok ( ( ) ) ,
4545- None if fun. is_record_constructor_function ( ) => assert_no_labelled_arguments ( & arguments, UnexpectedLabelledArgKind :: RecordConstructorArgument ) ,
4546- None => assert_no_labelled_arguments ( & arguments, UnexpectedLabelledArgKind :: FunctionParameter ) ,
4553+ None if fun. is_record_constructor_function ( ) => assert_no_labelled_arguments (
4554+ & arguments,
4555+ UnexpectedLabelledArgKind :: RecordConstructorArgument ,
4556+ ) ,
4557+ None => assert_no_labelled_arguments (
4558+ & arguments,
4559+ UnexpectedLabelledArgKind :: FunctionParameter ,
4560+ ) ,
45474561 }
45484562 } ) ;
45494563
0 commit comments