typescript-monads icon indicating copy to clipboard operation
typescript-monads copied to clipboard

Property 'toResult' is missing in type 'IMaybe<T>' but required in type 'Maybe<T>'

Open nielinjie opened this issue 3 years ago • 1 comments

When I use none function, it return a "IMaybe" interface instead of "Maybe", but there is no "toResult" in "IMaybe", so, it is not a "Maybe".

If I set 'strict' in tsconfig.json to 'false', errors gone.

So is it a bug?

src/domain/tree.ts:42:10 - error TS2741: Property 'toResult' is missing in type 'IMaybe<T>' but required in type 'Maybe<T>'.

42     else return none()
            ~~~~~~~~~~~~~

  node_modules/typescript-monads/maybe/maybe.d.ts:27:5
    27     toResult<E>(error: E): IResult<T, E>;
           ~~~~~~~~
    'toResult' is declared here.

nielinjie avatar Jun 15 '22 03:06 nielinjie

You are right, this is an issue thanks

patrickmichalina avatar Aug 17 '22 04:08 patrickmichalina

:tada: This issue has been resolved in version 8.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

patrickmichalina avatar Nov 03 '22 08:11 patrickmichalina