Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# not recognizing members of a record type

Tags:

f#

recordtype

I am doing a simple mapping and the compiler doesn't recognize the record's members. The image shows the type OpeningHours itself is clearly ok, with all 3 properties showing:

Recognized record type with all members

But hovering over the marked property shows:

error FS0039: The field, constructor or member 'Day' is not defined.

Namespaces are all referenced and I even assign to the very same properties few lines below without any issue.

like image 1000
zmaten Avatar asked Jan 02 '23 17:01

zmaten


1 Answers

OpeningHours is a class, not a record. This is one way to create an instance of the class:

OpeningHours(day = oh.Day, opens = oh.Opens, closes = oh.Closes)
like image 145
TheQuickBrownFox Avatar answered Jan 13 '23 11:01

TheQuickBrownFox