example code for https://github.com/JuliaLang/julia/issues/7051