Skip to content

Commit 074a266

Browse files
committed
Add test
1 parent 486e1f7 commit 074a266

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

compiler/syntax/src/res_core.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4229,7 +4229,8 @@ and parse_record_or_object_type ?current_type_name_path ?inline_types_context
42294229
| _ -> Asttypes.Closed
42304230
in
42314231
match (inline_types_context, current_type_name_path) with
4232-
| Some inline_types_context, Some current_type_name_path when Grammar.is_record_decl_start p.token ->
4232+
| Some inline_types_context, Some current_type_name_path
4233+
when Grammar.is_record_decl_start p.token ->
42334234
let labels =
42344235
parse_comma_delimited_region ~grammar:Grammar.RecordDecl ~closing:Rbrace
42354236
~f:

tests/tests/src/nested_records_with_type_params.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
let options = {
55
extra: {
6+
extraField: {
7+
theField: true
8+
},
69
name: "test",
710
superExtra: {
811
age: 2222
@@ -18,6 +21,9 @@ let options = {
1821

1922
let opts2 = {
2023
extra: {
24+
extraField: {
25+
theField: true
26+
},
2127
name: "test",
2228
superExtra: {
2329
age: "1234"

tests/tests/src/nested_records_with_type_params.res

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
type options<'age> = {
22
extra?: {
3+
mutable extraField: {theField: bool},
34
name: string,
45
superExtra?: {age: 'age},
56
otherExtra: option<{test: bool, anotherInlined: {record: bool}}>,
@@ -8,6 +9,7 @@ type options<'age> = {
89

910
let options = {
1011
extra: {
12+
extraField: {theField: true},
1113
name: "test",
1214
superExtra: {
1315
age: 2222,
@@ -18,6 +20,7 @@ let options = {
1820

1921
let opts2: options<string> = {
2022
extra: {
23+
extraField: {theField: true},
2124
name: "test",
2225
superExtra: {
2326
age: "1234",

0 commit comments

Comments
 (0)