Finally fixed @extend within a loop context. Added a small test case and all previous cases are passing.
Move the function to the root of the file.
Merge pull request #967 from blakeembrey/loop-scope

Finally fixed @extend within a loop context