From a758550948eba09ff13c5a2abce3b6e7abfb2571 Mon Sep 17 00:00:00 2001 From: Cedric St-Jean Date: Thu, 30 Jun 2016 10:08:54 -0400 Subject: [PATCH 1/2] Add type assertion to `Symbol` method. Fix #242 --- src/Compat.jl | 2 +- test/runtests.jl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Compat.jl b/src/Compat.jl index 1f719f685..a5eb634ba 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -397,7 +397,7 @@ if VERSION < v"0.4.0-dev+3732" calltypes[k] = v end elseif VERSION < v"0.5.0-dev+3831" - Base.Symbol(args...) = symbol(args...) + Base.Symbol(args...) = symbol(args...)::Symbol end if VERSION < v"0.5.0-dev+2396" diff --git a/test/runtests.jl b/test/runtests.jl index 208c46ff3..08b1b2db9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1160,6 +1160,8 @@ if VERSION ≥ v"0.4.0-dev+3732" @test Symbol("a_", 2) === :a_2 @test Symbol('c') === :c @test Symbol(1) === Symbol("1") + # Behaviour on 0.5 might change JuliaLang/julia#7258 + @test keytype([Symbol(k) => v for (k,v) in Dict{Any, Any}(:x=>3)]) == Symbol end foostring(::String) = 1 From 9a678d24d677cb5c84a00014d2817c2e843f5678 Mon Sep 17 00:00:00 2001 From: Cedric St-Jean Date: Thu, 30 Jun 2016 10:37:18 -0400 Subject: [PATCH 2/2] Remove comprehension type inference test --- test/runtests.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 08b1b2db9..208c46ff3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1160,8 +1160,6 @@ if VERSION ≥ v"0.4.0-dev+3732" @test Symbol("a_", 2) === :a_2 @test Symbol('c') === :c @test Symbol(1) === Symbol("1") - # Behaviour on 0.5 might change JuliaLang/julia#7258 - @test keytype([Symbol(k) => v for (k,v) in Dict{Any, Any}(:x=>3)]) == Symbol end foostring(::String) = 1