Skip to content

Commit

Permalink
type docs: add generalization of NoFields example (#35938)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed May 21, 2020
1 parent 2155199 commit 40a8b42
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/src/manual/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,18 @@ true

The [`===`](@ref) function confirms that the "two" constructed instances of `NoFields` are actually one
and the same. Singleton types are described in further detail [below](@ref man-singleton-types).
More generally, if all the fields of an immutable structure are indistinguishable (`===`) then two
immutable values containing those fields are also indistinguishable:

```jldoctest
julia> struct X
a::Int
b::Float64
end
julia> X(1, 2) === X(1, 2)
true
```

There is much more to say about how instances of composite types are created, but that discussion
depends on both [Parametric Types](@ref) and on [Methods](@ref), and is sufficiently important
Expand Down

2 comments on commit 40a8b42

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.