Regression spec for 'stack level too deep' #5384

Fixes #5384