E1066: returned view has no single abs origin
A verb that returns -> abs hands out a view of something.
A verb that returns -> abs hands out a view of something. ADR-0021 requires
the view to come from exactly one place, which must be an abs parameter of
the same verb, so the caller knows which owner it borrows from. The compiler
rejects an abs return when the verb has more than one non-scalar abs
parameter, when the returned value comes from a local, and when it mixes
several origins or has an unknown one. The message gives the reason. The error
points at the returned expression.
Example
Fix
Take one abs parameter and return a view of it. Do not return a view of a
value that the verb creates, because it would not outlive the call.
Run actus explain E1066 in your terminal to read this entry offline. Browse Ownership & types or all error codes.