diff --git a/base/env.jl b/base/env.jl index 0f41a5bbf170e..fc3fe87e78c70 100644 --- a/base/env.jl +++ b/base/env.jl @@ -86,10 +86,10 @@ if is_windows() start(hash::EnvHash) = (pos = ccall(:GetEnvironmentStringsW,stdcall,Ptr{UInt16},()); (pos,pos)) function done(hash::EnvHash, block::Tuple{Ptr{UInt16},Ptr{UInt16}}) if unsafe_load(block[1]) == 0 - ccall(:FreeEnvironmentStringsW,stdcall,Int32,(Ptr{UInt16},),block[2]) + ccall(:FreeEnvironmentStringsW, stdcall, Int32, (Ptr{UInt16},), block[2]) return true end - false + return false end function next(hash::EnvHash, block::Tuple{Ptr{UInt16},Ptr{UInt16}}) pos = block[1] @@ -102,7 +102,7 @@ function next(hash::EnvHash, block::Tuple{Ptr{UInt16},Ptr{UInt16}}) if m === nothing error("malformed environment entry: $env") end - (Pair{String,String}(m.captures[1], m.captures[2]), (pos+len*2, blk)) + return (Pair{String,String}(m.captures[1], m.captures[2]), (pos+len*2, blk)) end else # !windows @@ -114,12 +114,12 @@ function next(::EnvHash, i) if env === nothing throw(BoundsError()) end - env::String + env = env::String m = match(r"^(.*?)=(.*)$"s, env) if m === nothing error("malformed environment entry: $env") end - (Pair{String,String}(m.captures[1], m.captures[2]), i+1) + return (Pair{String,String}(m.captures[1], m.captures[2]), i+1) end end # os-test diff --git a/base/float16.jl b/base/float16.jl index 46dcb8bfaa0d7..69fbbc20ba421 100644 --- a/base/float16.jl +++ b/base/float16.jl @@ -1,11 +1,11 @@ # This file is a part of Julia. License is MIT: http://julialang.org/license function convert(::Type{Float32}, val::Float16) - ival::UInt32 = reinterpret(UInt16, val) - sign::UInt32 = (ival & 0x8000) >> 15 - exp::UInt32 = (ival & 0x7c00) >> 10 - sig::UInt32 = (ival & 0x3ff) >> 0 - ret::UInt32 + local ival::UInt32 = reinterpret(UInt16, val), + sign::UInt32 = (ival & 0x8000) >> 15, + exp::UInt32 = (ival & 0x7c00) >> 10, + sig::UInt32 = (ival & 0x3ff) >> 0, + ret::UInt32 if exp == 0 if sig == 0 diff --git a/base/sparse/sparsevector.jl b/base/sparse/sparsevector.jl index 4c303ff911cfa..83f99cc723028 100644 --- a/base/sparse/sparsevector.jl +++ b/base/sparse/sparsevector.jl @@ -1370,8 +1370,7 @@ end ### BLAS-2 / sparse A * sparse x -> dense y function densemv(A::SparseMatrixCSC, x::AbstractSparseVector; trans::Char='N') - xlen::Int - ylen::Int + local xlen::Int, ylen::Int m, n = size(A) if trans == 'N' || trans == 'n' xlen = n; ylen = m diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index becc3a9f99d5d..770aaae2633b4 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -1684,8 +1684,10 @@ (else `(block ,.(map (lambda (x) - (if (decl? x) - `(decl ,@(map expand-forms (cdr x))) + (if (and (decl? x) (length= (cdr x) 2) (symbol? (cadr x))) + (let ((str-x (deparse x))) + (syntax-deprecation #f str-x (string "local " str-x)) + `(decl ,@(map expand-forms (cdr x)))) (expand-forms x))) (butlast (cdr e))) ,(expand-forms (last (cdr e))))))) diff --git a/test/core.jl b/test/core.jl index d98db8c25826f..81d8b36db7706 100644 --- a/test/core.jl +++ b/test/core.jl @@ -3160,8 +3160,9 @@ immutable Foo11874 end function bar11874(x) - y::Foo11874 - y=x + local y::Foo11874 + y = x + nothing end Base.convert(::Type{Foo11874},x::Int) = float(x)