# Cannot \`convert\` an object of type Void to an object of type Bool

**URL:** <https://discourse.julialang.org/t/cannot-convert-an-object-of-type-void-to-an-object-of-type-bool/11992>\
**Category:** New to Julia\
**Created:** [June 27, 2018, 10:06am UTC](https://discourse.julialang.org/t/cannot-convert-an-object-of-type-void-to-an-object-of-type-bool/11992 "2018-06-27T10:06:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)\
**Post date:** [June 27, 2018, 10:06am UTC](https://discourse.julialang.org/t/cannot-convert-an-object-of-type-void-to-an-object-of-type-bool/11992/1 "2018-06-27T10:06:26Z")

</div>

Hi

I have a long piece of code containing the following lines

```julia
println(typeof(BREAK))
BREAK = true # BREAK ALL FOR-LOOPS

```

This returns the code provided below. The first line indicates that BREAK is Bool, as it should be, but then an error is returned and the line number indicated (219) is the line with BREAK is assigned the value true.  
Any hint why this may be happening?

```julia
Bool
ERROR: LoadError: MethodError: Cannot `convert` an object of type Void to an object of type Bool
This may have arisen from a call to the constructor Bool(...),
since type constructors fall back to convert methods.
Stacktrace:
 [1] (::#enumerate_resist#79{DataMMM})(::Int64) at /home/mposs/Dropbox/Workspace/julia/MMMKnapsack/combi_k_resist.jl:219
 [2] (::#enumerate_resist#79{DataMMM})(::Int64) at /home/mposs/Dropbox/Workspace/julia/MMMKnapsack/combi_k_resist.jl:153
 [3] algo_combi_k_resist(::Float64, ::DataMMM) at /home/mposs/Dropbox/Workspace/julia/MMMKnapsack/combi_k_resist.jl:321
 [4] macro expansion at /home/mposs/Dropbox/Workspace/julia/MMMKnapsack/run_SP.jl:63 [inlined]
 [5] anonymous at ./<missing>:?
 [6] include_from_node1(::String) at ./loading.jl:576
 [7] include(::String) at ./sysimg.jl:14
 [8] process_options(::Base.JLOptions) at ./client.jl:305
 [9] _start() at ./client.jl:371
while loading /home/mposs/Dropbox/Workspace/julia/MMMKnapsack/run_SP.jl, in expression starting on line 46

```

---

<div class="post-metadata">

**Author:** ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)\
**Post date:** [June 27, 2018, 10:18am UTC](https://discourse.julialang.org/t/cannot-convert-an-object-of-type-void-to-an-object-of-type-bool/11992/2 "2018-06-27T10:18:42Z")

</div>

Problem solved, I forgot a method was returning a Bool.
