F # not recognizing record type members

I am doing a simple mapping, and the compiler does not recognize the entries. The image shows that the type is OpeningHoursclearly good, with all 3 properties showing:

Recognized post type with all members

But hovering over the marked property shows:

error FS0039: Field, constructor, or Day member not defined.

All namespaces are referenced and I even assign the same properties to the few lines below without any problems.

+4
source share
2 answers

Based on the constructor and properties, it looks like this: it OpeningHoursis defined as a class, not a record. The syntax of a record cannot be used with classes, so the solution can either change OpeningHoursto a record or create it using an existing constructor.

+4

OpeningHours - , . :

OpeningHours(day = oh.Day, opens = oh.Opens, closes = oh.Closes)
+5

Source: https://habr.com/ru/post/1694343/


All Articles