Skip to content

Commit

Permalink
test(parseError): unbound namespaced record field error
Browse files Browse the repository at this point in the history
  • Loading branch information
ayshiff committed Sep 29, 2020
1 parent bd741d0 commit 3de4d1f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let f (x : Complex.t) = x.Complex.z;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Unformatted Error Output:
# File "tests/__tests__/refmterr/__fixtures__/type_UnboundRecordField/type_UnboundRecordField_3.ml", line 1, characters 26-35:
# Error: Unbound record field Complex.z


 ERROR  tests/__tests__/refmterr/__fixtures__/type_UnboundRecordField/type_UnboundRecordField_3.ml:1 26-35

1 ┆ let f (x : Complex.t) = x.Complex.z;

Record field Complex.z can't be found in any record type.

Record fields must be "in scope". That means you need to `open TheModule` where the record type is defined.
Alternatively, instead of opening a module, you can prefix the record field name like {TheModule.x: 0, y: 100}.


2 changes: 1 addition & 1 deletion tests/__tests__/refmterr/refmterr_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let folders = [
("type_RecordFieldNotBelong", 3, [], []),
("type_RecordFieldsUndefined", 1, [], []),
("type_UnboundModule", 2, [], []),
("type_UnboundRecordField", 2, [], []),
("type_UnboundRecordField", 3, [], []),
("type_UnboundTypeConstructor", 2, [], []),
("type_UnboundValue", 4, [], []),
("type_FunctionWrongLabel", 5, [], []),
Expand Down

0 comments on commit 3de4d1f

Please sign in to comment.