Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

`some Shape` is literally identical to `impl Shape`, including the semantics you discuss above. The compile-time return value of a function returning `some Shape` must be the same on all execution paths. It just avoids expressing to the caller what it is.

Incidentally, this in principle allows the optimiser to specialise the caller to the return type of this function, avoiding the existential altogether.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: