hoaproject / Option

The Hoa\Option library.
https://hoa-project.net/
9 stars 3 forks source link

unwrap message #10

Closed mathroc closed 7 years ago

mathroc commented 7 years ago

return $this->expect('Unwrap a null value.');

should null appear in the error message ? maybe something with None instead so that $this->value remains an implementation details ?

I saw that the class comment says

None which is the equivalent of null

so it might be that null is not only an implementation detail

Hywan commented 7 years ago

Rust std::option::Option panicked with the following message:

thread 'main' panicked at 'called Option::unwrap() on a None value', /checkout/src/libcore/option.rs:33

It fits with your suggestion. I will make a PR.

Hywan commented 7 years ago

@mathroc Please, could you review #12? Thanks!