Added test case to prevent regression of chained, preloaded scopes.

As discussed in #7792, this PR includes a test case that will prevent a regression of #7490 on master.