View types are part of the memory safe Nim subset and so we have to protect ourselves against mutations of global variables performed by other threads. Your workaround is a nice way to show this protection is not nearly good enough. :-)
Not sure how to solve it. Maybe view types should be restricted to `func`. Also notice that view types are still so broken that we didn't announce them for 1.4. :-)
