> 1\. Why is this not allowed? The manual doesn't explain it. (also the link in > the error message both doesn't work and why it doesn't work is described in a > different section)
The anchor is now `#view-types-path-expressions`, I suppose the error message wasn't up-to-date. > 2\. Is my workaround just an oversight? And if yes how will it be prevented, > will the creation of the view with the call already be an error? >From the >[spec](https://nim-lang.github.io/Nim/manual_experimental.html#view-types) >this seems to be deliberate: > Let `source` be one of: > > * A formal parameter of p. Note that this does not cover parameters of > inner procs. > * The result symbol of p. > * A local var or let or const of p. Note that this does not cover locals of > inner procs. > * A thread-local var or let. > * A global let or const. > * A constant array/seq/object/tuple constructor. > Your second example fullfills the 1st case, so it's allowed. Note that if you try to return an openArray from the parameter, you'll see the same error as the first example. Also the view spec only applies to local variables containing the view, not parameters (`openArray[T]` parameter type would be rather useless if it has the restrictions of local variables applied to it IMO). This is just my speculation and for a detailed answer you gotta wait for @Araq himself.
