Test for #1346: assertion substitution leaks out of its containing scope