# Struct field change bug - can't understand why?

**URL:** <https://discourse.julialang.org/t/struct-field-change-bug-cant-understand-why/9377>\
**Category:** New to Julia\
**Created:** [February 27, 2018, 8:17pm UTC](https://discourse.julialang.org/t/struct-field-change-bug-cant-understand-why/9377 "2018-02-27T20:17:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [February 27, 2018, 8:17pm UTC](https://discourse.julialang.org/t/struct-field-change-bug-cant-understand-why/9377/1 "2018-02-27T20:17:03Z")

</div>

I’m trying to understand why the compiler produces an error when you try to change a field of a mutable struct after a “”" comment “”".

I tried to reduce this to the minimum possible code that reproduces this error, :

```julia
mutable struct teststruct

    a::Float64

    b::String

end

testinstance = teststruct(0.5, "hello")

testinstance.a = 0.1 # works fine

"""a comment string"""

testinstance.a = 0.75 # generates error message

```

The error I get is:

```julia
ERROR: LoadError: MethodError: no method matching Base.Docs.Binding(::teststruct, ::Symbol)
Closest candidates are:
  Base.Docs.Binding(!Matched::Module, ::Symbol) at docs\bindings.jl:12
Stacktrace:
 [1] include_from_node1(::String) at .\loading.jl:576
 [2] include(::String) at .\sysimg.jl:14
 [3] process_options(::Base.JLOptions) at .\client.jl:305
 [4] _start() at .\client.jl:371
while loading C:\Projects\11_Louis\osContrib\heisenbug\test.jl, in expression starting on line 522

```

Thanks for any help on this.

---

<div class="post-metadata">

**Author:** ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)\
**Post date:** [February 27, 2018, 8:42pm UTC](https://discourse.julialang.org/t/struct-field-change-bug-cant-understand-why/9377/2 "2018-02-27T20:42:04Z")

</div>

Because that is not a comment.

See also [""" vs #= =# comment - #11 by devel-chm](https://discourse.julialang.org/t/vs-comment/8774/11)

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [February 27, 2018, 8:42pm UTC](https://discourse.julialang.org/t/struct-field-change-bug-cant-understand-why/9377/3 "2018-02-27T20:42:36Z")

</div>

This is a doc-string, which tries to attach the doc to something but fails and thus errors. Use `#` for comments.

---

<div class="post-metadata">

**Author:** ![anon32405968](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Post date:** [February 28, 2018, 10:55am UTC](https://discourse.julialang.org/t/struct-field-change-bug-cant-understand-why/9377/4 "2018-02-28T10:55:12Z")

</div>

thanks for clarifying, missed that in the manual and assumed Python-like behavior, my mistake 🙂
