From 4c0a3e64fe7d71b4dbeb4c802d0ecda26d27c8c8 Mon Sep 17 00:00:00 2001 From: quinnj Date: Mon, 4 Sep 2017 19:46:47 -0600 Subject: [PATCH] Probably due to #23397; ensure the istart variable is declared outside the while loop --- base/cartesian.jl | 1 + test/cartesian.jl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/base/cartesian.jl b/base/cartesian.jl index 6762b4db15461..b944617726345 100644 --- a/base/cartesian.jl +++ b/base/cartesian.jl @@ -302,6 +302,7 @@ function lreplace!(str::AbstractString, r::LReplace) pat = r.pat_str j = start(pat) matching = false + local istart::Int while !done(str, i) cstr, i = next(str, i) if !matching diff --git a/test/cartesian.jl b/test/cartesian.jl index be2605d200143..cf8ed426468c5 100644 --- a/test/cartesian.jl +++ b/test/cartesian.jl @@ -3,3 +3,5 @@ @test Base.Cartesian.exprresolve(:(1 + 3)) == 4 ex = Base.Cartesian.exprresolve(:(if 5 > 4; :x; else :y; end)) @test ex.args[2] == QuoteNode(:x) + +@test Base.Cartesian.lreplace!("val_col", Base.Cartesian.LReplace{String}(:col, "col", 1)) == "val_1" \ No newline at end of file