Closed Ailrun closed 5 years ago
Following code gives me Just<string | undefined>
Just<string | undefined>
function test(v: string | undefined): {} { return Maybe.from(v); }
and if I gave <string> to from, i.e., calling it as Maybe.from<string>(v), it gives me a error
<string>
from
Maybe.from<string>(v)
Type 'undefined' is not assignable to type 'string'
from<T>(value?: T | null): Maybe<T>
@JohannesHome
Description
Following code gives me
Just<string | undefined>
and if I gave
<string>
tofrom
, i.e., calling it asMaybe.from<string>(v)
, it gives me a errorPossible Solution
from
and usefrom<T>(value?: T | null): Maybe<T>
only.Reported by
@JohannesHome