# Debugging Function-Like object under Juno

**URL:** https://discourse.julialang.org/t/debugging-function-like-object-under-juno/26079
**Category:** General Usage
**Tags:** juno, debug
**Created:** [July 6, 2019, 9:15pm UTC](https://discourse.julialang.org/t/debugging-function-like-object-under-juno/26079 "2019-07-06T21:15:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [July 6, 2019, 9:15pm UTC](https://discourse.julialang.org/t/debugging-function-like-object-under-juno/26079/1 "2019-07-06T21:15:47Z")

</div>

I suspect this is a bug, but I’d like a second opinion in case I’m doing something wrong.

Julia version:

```julia
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, sandybridge)
Environment:
  JULIA_EDITOR = atom -a
  JULIA_NUM_THREADS = 4

```

A simplified example:

```julia
struct Data{Symbol}
   value::Int
end

mutable struct FunLike
   value::Int
   FunLike() = new(0)
end

function (f::FunLike)(x::Data{:a})
   f.value += x.value
end

function (f::FunLike)(x::Data{:b})
   f.value *= x.value
end

```

Now under REPL in Atom/Juno if you run:

```julia
t=FunLike()
@Juno.enter t(Data{:a}(2))

```

You end up stopped in sysimg.jl line 19:

```julia
setproperty!(x, f::Symbol, v) = setfield!(x, f, convert(fieldtype(typeof(x), f), v))

```

The correct function **does** execute, but I can’t for the life of me stop in that function. Or maybe creating multiple methods for a function like object is considered bad form?

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [July 11, 2019, 10:59am UTC](https://discourse.julialang.org/t/debugging-function-like-object-under-juno/26079/2 "2019-07-11T10:59:36Z")

</div>

This is an issue in the heuristic JuliaInterpreter uses to step through warpper functions:  
[https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/299](https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/299)

---

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [July 11, 2019, 11:43am UTC](https://discourse.julialang.org/t/debugging-function-like-object-under-juno/26079/3 "2019-07-11T11:43:27Z")

</div>

Cool, thank you.
