문제

I'm working 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'm trying to make:

myElement.numbers

The following error is returned: Error: Unbound record field label numbers.

Thanks, any help is welcome.

도움이 되었습니까?

해결책

Use a fully qualified name from file2: myElement.File1.numbers

or add an open File to your file.

or use local module opens let open File2 in myElement.numbers

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top