Effect CommunityEC
Effect Community3y ago
17 replies
Bene

Error when assigning `Option.none` to `test` property in type `T`

Hi there, would anyone know why this is erroring? I'm trying to have incorrect state unrepresentable, but looks like Option.none has Option type instead of None. Am I doing it wrong?
type T = { _tag: 'WithSome', test: Option.Some<number> } | { _tag: 'WithNone', test: Option.None<number> };

const thisErrors: T = {
  _tag: 'WithNone',
  test: Option.none<number>()
}
Was this page helpful?