Variable Record Fields with Multiple Files

I work with multiple files and I have a problem with one mutable field. In file1.ml, I declared:

type mytype = { mutable numbers : int list; } 

So in file2.ml I have elements of type mytype. But, when I try to do:

 myElement.numbers 

The following error is given: Error: Label numbers of residual fields.

Thanks, any help is appreciated.

+4
source share
1 answer

Use the full name from file2: myElement.File1.numbers

or add open File to your file.

or open the local module let open File2 in myElement.numbers

+5
source

All Articles