# Works in Atom/Juno not in REPL

**URL:** https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534
**Category:** General Usage
**Created:** [December 5, 2017, 3:04pm UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534 "2017-12-05T15:04:33Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Daneel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daneel/32/175_2.png) [@Daneel](https://discourse.julialang.org/u/Daneel)
#### Post date: [December 5, 2017, 3:04pm UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/1 "2017-12-05T15:04:33Z")

</div>

I’m in the process of updating a module I’ve been working on due to breaking changes in DataFrames. Using `Pkg.test` to call the tests that I had setup before the breaking changes works when I run it through the Atom/Juno console but not in REPL. In the REPL I get the following errors.

```julia
ERROR: MethodError: no method matching convert(::Type{AssertionError}, ::String)
Closest candidates are:
  convert(::Type{Any}, ::ANY) at essentials.jl:28
  convert(::Type{T}, ::T) where T at essentials.jl:29
Stacktrace:
 [1] AssertionError(::String) at ./coreimg.jl:14
 [2] update_valid_age!(::UInt64, ::UInt64, ::Core.Inference.InferenceState) at ./inference.jl:2353
 [3] abstract_call_gf_by_type(::Any, ::Any, ::Core.Inference.InferenceState) at ./inference.jl:1431
 [4] abstract_call(::Any, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1897
 [5] abstract_eval_call(::Expr, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1927
 [6] abstract_eval(::Any, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1950
 [7] abstract_interpret(::Any, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:2076
 [8] typeinf_work(::Core.Inference.InferenceState) at ./inference.jl:2669
 [9] typeinf(::Core.Inference.InferenceState) at ./inference.jl:2787
 [10] typeinf_edge(::Method, ::Any, ::SimpleVector, ::Core.Inference.InferenceState) at ./inference.jl:2535
 [11] abstract_call_gf_by_type(::Any, ::Any, ::Core.Inference.InferenceState) at ./inference.jl:1420
 [12] abstract_call(::Any, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1897
 [13] abstract_eval_call(::Expr, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1927
 [14] abstract_eval(::Any, ::Array{Any,1}, ::Core.Inference.InferenceState) at ./inference.jl:1950
 [15] typeinf_work(::Core.Inference.InferenceState) at ./inference.jl:2722
 [16] typeinf(::Core.Inference.InferenceState) at ./inference.jl:2787
 [17] typeinf_frame(::Core.MethodInstance, ::Bool, ::Bool, ::Core.Inference.InferenceParams) at ./inference.jl:2504
 [18] typeinf_code(::Core.MethodInstance, ::Bool, ::Bool, ::Core.Inference.InferenceParams) at ./inference.jl:2583
 [19] typeinf_ext(::Core.MethodInstance, ::UInt64) at ./inference.jl:2622

```

I can call the function itself from the console in Atom and it works as well. What is interference.jl?

* * *

Julia 0.6.1  
Commit 0d7248e2ff (2017-10-24 22:15 UTC)  
Platform Info:  
OS: Linux (x86\_64-pc-linux-gnu)  
CPU: Intel(R) Core™ i5-4570 CPU @ 3.20GHz  
WORD\_SIZE: 64  
BLAS: libopenblas (USE64BITINT DYNAMIC\_ARCH NO\_AFFINITY Haswell)  
LAPACK: libopenblas64\_  
LIBM: libopenlibm  
LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

```julia
Dict{String,VersionNumber} with 78 entries:
  "Libz" => v"0.2.4"
  "Juno" => v"0.3.2"
  "Lazy" => v"0.12.0"
  "Nullables" => v"0.0.1"
  "ZMQ" => v"0.5.1"
  "DataStructures" => v"0.7.2"
  "Compat" => v"0.39.0"
  "LNR" => v"0.0.2"
  "CategoricalArrays" => v"0.3.0"
  "Calculus" => v"0.2.2"
  "GZip" => v"0.3.0"
  "Measures" => v"0.1.0"
  "StatsFuns" => v"0.5.0"
  "RecipesBase" => v"0.2.3"
  "JLD2" => v"0.0.4"
  "CodeTools" => v"0.4.7"
  "HttpParser" => v"0.3.0"
  "DataFrames" => v"0.11.1"
  "SpecialFunctions" => v"0.3.5"
  "Requires" => v"0.4.3"
  "Blosc" => v"0.3.0"
  "Showoff" => v"0.1.1"
  "Distributions" => v"0.15.0"
  "Mux" => v"0.2.3"
  "ZipFile" => v"0.4.0"
  "FixedPointNumbers" => v"0.4.3"
  "SHA" => v"0.5.2"
  "Missings" => v"0.2.2"
  "Media" => v"0.3.0"
  "HDF5" => v"0.8.8"
  "ColorTypes" => v"0.6.6"
  "BufferedStreams" => v"0.3.3"
  "MbedTLS" => v"0.5.1"
  "DebuggerFramework" => v"0.1.2"
  "FileIO" => v"0.6.1"
  "StringDistances" => v"0.2.0"
  "HttpServer" => v"0.2.0"
  "PlotThemes" => v"0.1.4"
  "Contour" => v"0.4.0"
  "CSV" => v"0.2.0"
  "PDMats" => v"0.7.1"
  "Revise" => v"0.1.1"
  "Atom" => v"0.6.5"
  "SortingAlgorithms" => v"0.2.0"
  "Conda" => v"0.7.0"
  "WeakRefStrings" => v"0.4.0"
  "Hiccup" => v"0.1.1"
  "Gallium" => v"0.1.0"
  "PyCall" => v"1.15.0"
  "PlotUtils" => v"0.4.4"
  "JSON" => v"0.16.2"
  "DocSeeker" => v"0.1.0"
  "StatsBase" => v"0.19.2"
  "IJulia" => v"1.6.2"
  "Distances" => v"0.5.0"
  "Plots" => v"0.13.1"
  "PyPlot" => v"2.3.2"
  "QuadGK" => v"0.1.3"
  "StaticArrays" => v"0.6.6"
  "BinDeps" => v"0.8.0"
  "Mustache" => v"0.3.0"
  "Reexport" => v"0.0.3"
  "NaNMath" => v"0.3.0"
  "URIParser" => v"0.2.0"
  "DataStreams" => v"0.3.1"
  "Rmath" => v"0.3.0"
  "Tokenize" => v"0.4.2"
  "IterTools" => v"0.1.0"
  "ASTInterpreter2" => v"0.1.1"
  "LaTeXStrings" => v"0.3.0"
  "PkgDev" => v"0.1.6"
  "Blink" => v"0.5.4"
  "Colors" => v"0.8.2"
  "WebSockets" => v"0.4.0"
  "MacroTools" => v"0.4.0"
  "NamedTuples" => v"4.0.0"
  "HttpCommon" => v"0.3.0"
  "Codecs" => v"0.4.0"

```

Atom 1.21.1 x64  
language-julia 0.13.0  
julia-client 0.6.6  
ink 0.7.11  
latex-completions 0.3.3  
uber-juno 0.1.2  
…

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [December 5, 2017, 3:35pm UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/2 "2017-12-05T15:35:18Z")

</div>

`inference.jl` is Julia’s internal implementation of type inference (the tool that figures out the correct concrete types given your method definitions and input variables). An error inside inference may indicate that you’ve found a bug in Julia itself.

Can you post a reproducible example? Ideally, one that is as short as possible?

For example, can you trigger the error by just going into the package and running: `julia test/runtests.jl` ? And if so, how much of the contents of `runtests.jl` can you remove while still seeing the error?

---

<div class="post-metadata">

### Author: ![ZacLN](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zacln/32/2748_2.png) [@ZacLN](https://discourse.julialang.org/u/ZacLN)
#### Post date: [December 5, 2017, 3:57pm UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/3 "2017-12-05T15:57:50Z")

</div>

This same issue came up wrt julia-vscode recently

---

<div class="post-metadata">

### Author: ![Daneel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daneel/32/175_2.png) [@Daneel](https://discourse.julialang.org/u/Daneel)
#### Post date: [December 6, 2017, 10:03am UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/4 "2017-12-06T10:03:25Z")

</div>

I zipped and uploaded the [package](https://drive.google.com/file/d/1nrbKQxlSqKKP1Fa7JRhe1mT4y6FPmvJr/view?usp=sharing). I’m not entirely sure why the failure happens but I have it down to _one_ example. The problem file that I’ve chosen doesn’t even need to be called to trigger the error.

Comment out line 11 of runtests.jl and line 12 (the problem file) will run. Move the block comment in slt\_trim.jl up one line and runtests.jl finishes with both lines 11 and 12 being run.

The “problem” chunk of code in slt\_trim.jl is nothing special. `files` is an array of strings of file paths and `fdates` is an array of DateTime corresponding to each file.

```julia
# Sort Files by Type
f = [ismatch(r"\.slt$",i) for i in files]
sltfiles = files[f]
sltdates = fdates[f]
f = [ismatch(r"\.csr$",i) for i in files]
csrfiles = files[f]
csrdates = fdates[f]
f = [ismatch(r"\.csu$",i) for i in files]#=
csufiles = files[f]
csudates = fdates[f]
f = [ismatch(r"\.flx$",i) for i in files]
flxfiles = files[f]
flxdates = fdates[f]

```

It makes no sense why it fails here because it just nearly the exact same code is above and blow the block comment.

Other functions in this package use this same method but I haven’t checked if they each fail at this point. As many functions as possible were commented out from the main module file.

---

<div class="post-metadata">

### Author: ![Daneel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daneel/32/175_2.png) [@Daneel](https://discourse.julialang.org/u/Daneel)
#### Post date: [December 12, 2017, 3:33pm UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/5 "2017-12-12T15:33:22Z")

</div>

I seem to have fixed it although I don’t know why it failed where it did 🤔. [Here](https://drive.google.com/file/d/1PHUahvUidYOlVqPfuLabCCFCXv9n1BeZ/view?usp=sharing) is the updated module.

In short, I added return types to the function definitions. As far as I can see though the return types should have been clear. Now that it’s working I’ll keep udpating it for DataFrames 0.11 and CSV while looking out for any type instabilities.

---

<div class="post-metadata">

### Author: ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)
#### Post date: [January 27, 2018, 10:54pm UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/6 "2018-01-27T22:54:46Z")

</div>

This bit me too. Is there an issue in the tracker I can add my observations to?

Edit: I’ve noticed that I only have this error when I start my session with `using Revise`. I cleared out my `./julia/v0.6` folder and reinstalled packages and still get the error. The `Revise` workflow was working for me before today which what led be to believe that newly-installed Juno was the problem but now I’m starting to doubt that.

---

<div class="post-metadata">

### Author: ![Daneel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daneel/32/175_2.png) [@Daneel](https://discourse.julialang.org/u/Daneel)
#### Post date: [January 29, 2018, 7:25am UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/7 "2018-01-29T07:25:23Z")

</div>

I couldn’t narrow it down enough to open an issue. It still confuses me but it’s been solved and I don’t have enough time to really dig down and find the exact reason.

---

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [June 19, 2018, 12:49am UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/8 "2018-06-19T00:49:07Z")

</div>

> [@Daneel](#):
>
> ERROR: MethodError: no method matching convert(::Type{AssertionError}, ::String)

I am hitting this bug. I am on Julia v0.6.3. The error with the long stack trace seem to appear randomly. For tests it is pretty consistent.

Is there anything I can do at the moment to function despite this bug? Can I modify my code somehow to avoid this error?

---

<div class="post-metadata">

### Author: ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)
#### Post date: [June 19, 2018, 8:33am UTC](https://discourse.julialang.org/t/works-in-atom-juno-not-in-repl/7534/9 "2018-06-19T08:33:03Z")

</div>

In case someone else is running into this bug with Julia v0.6.3. A quick and dirty way to get your code running is to use the option `julia --compilecache=no`. Thans to @omus.

This is already resolved in v0.7, and should be be resolved (sooner) in v0.6.4.
