F # enum: expected to be of type xxx, but there is type xxx

I am trying to use LightningDB.net. One of the methods accepts arguments as enum flags.

Method declaration in C #:

Open(EnvironmentOpenFlags openFlags = EnvironmentOpenFlags.None, UnixAccessMode accessMode = UnixAccessMode.Default)

When I provide an argument for openFlags, for example: env.Open(EnvironmentOpenFlags.NoSync)I get a compiler error:

error FS0001: This expression was expected to have type LightningDB.EnvironmentOpenFlags but here has type LightningDB.EnvironmentOpenFlags

When I provide an argument for the second argument to a method, it works:

env.Open(accessMode = UnixAccessMode.Default)

Any combination, including attempting to convert enum to int and vice versa, always results in a compiler error.

This is on VS 2015. Any idea what could be causing this and how to work?

+4
source share
1

, , .

+3

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


All Articles