Error Accessing `value` in `Option.orElse`
Why does accessing the same
valuevalue cause an error in Option.orElseOption.orElse? if (Option.isNone(account.studentProfile)) {
// handle None
return ''
}
// this is ok
const foo = account.studentProfile.value.dateOfBirth
// this errors with:
// Property 'value' does not exist on type 'Option<StudentProfile>'
// Property 'value' does not exist on type 'None<StudentProfile>'
const bar = Option.orElse(() => account.studentProfile.value.dateOfBirth) if (Option.isNone(account.studentProfile)) {
// handle None
return ''
}
// this is ok
const foo = account.studentProfile.value.dateOfBirth
// this errors with:
// Property 'value' does not exist on type 'Option<StudentProfile>'
// Property 'value' does not exist on type 'None<StudentProfile>'
const bar = Option.orElse(() => account.studentProfile.value.dateOfBirth)