Skip to content

Commit 1b78e25

Browse files
committed
docs
docs Update base.md
1 parent ec81203 commit 1b78e25

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

base/docs/basedocs.jl

+29
Original file line numberDiff line numberDiff line change
@@ -1698,6 +1698,35 @@ Stacktrace:
16981698
"""
16991699
FieldError
17001700

1701+
"""
1702+
PropertyError(type::DataType, field::Symbol)
1703+
1704+
An operation tried to access invalid `property` of `type`.
1705+
1706+
!!! compat "Julia 1.12"
1707+
Prior to Julia 1.12, invalid field access threw an [`ErrorException`](@ref)
1708+
1709+
See [`getfield`, `FieldError``](@ref)
1710+
1711+
# Examples
1712+
```jldoctest
1713+
julia> struct AB
1714+
a::Float32
1715+
b::Float64
1716+
end
1717+
1718+
julia> ab = AB(1, 3)
1719+
AB(1.0f0, 3.0)
1720+
1721+
julia> ab.c # field `c` doesn't exist
1722+
ERROR: PropertyError: instance of `AB`` has no property `c`
1723+
Stacktrace:
1724+
[...]
1725+
```
1726+
"""
1727+
PropertyError
1728+
1729+
17011730
"""
17021731
WrappedException(msg)
17031732

0 commit comments

Comments
 (0)