Skip to content

Commit 54d8b51

Browse files
committed
Fixed error prints
1 parent dd94c62 commit 54d8b51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/lecture_06/compositetypes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Composite types declared with `struct` keyword are immutable and cannot be modif
187187

188188
```jldoctest structs
189189
julia> r.bottomleft = [2;2]
190-
ERROR: setfield! immutable struct of type Rectangle cannot be changed
190+
ERROR: setfield!: immutable struct of type Rectangle cannot be changed
191191
```
192192

193193
However, immutability is not recursive. If an immutable object contains a mutable object, such as an array, elements of this mutable object can be modified. Even though `Rectangle` is an immutable type, its `bottomleft` field is a mutable array and can be changed.
@@ -585,7 +585,7 @@ The `methods` function shows that Julia created three constructors. The `@kwdef
585585
```jldoctest structs
586586
julia> methods(MyType)
587587
# 3 methods for type constructor:
588-
[1] MyType(; a, b, c) in Main at util.jl:450
588+
[1] MyType(; a, b, c) in Main at util.jl:478
589589
[2] MyType(a::Int64, b::Float64, c::String) in Main at none:2
590590
[3] MyType(a, b, c) in Main at none:2
591591
```

0 commit comments

Comments
 (0)