Skip to content

Commit 7639054

Browse files
types.md: consistently use n-dashes (#37566)
1 parent 4f0145b commit 7639054

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

doc/src/devdocs/types.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ Therefore in this case the diagonal rule is not really necessary, since
367367
the array determines `T` and we can then allow `x` and `y` to be of
368368
any subtypes of `T`.
369369
So variables that occur in invariant position are never considered diagonal.
370-
This choice of behavior is slightly controversial --- some feel this definition
370+
This choice of behavior is slightly controversial -- some feel this definition
371371
should be written as
372372

373373
```julia
@@ -418,15 +418,19 @@ whether that appearance of the variable is used or not.
418418
Otherwise types can behave differently depending on which other types
419419
they are compared to, making subtyping not transitive. For example, consider
420420

421+
```julia
421422
Tuple{Int,Int8,Vector{Integer}} <: Tuple{T,T,Vector{Union{Integer,T}}} where T
423+
```
422424

423-
If the `T` inside the Union is ignored, then `T` is concrete and the answer is "false"
425+
If the `T` inside the `Union` is ignored, then `T` is concrete and the answer is "false"
424426
since the first two types aren't the same.
425427
But consider instead
426428

429+
```julia
427430
Tuple{Int,Int8,Vector{Any}} <: Tuple{T,T,Vector{Union{Integer,T}}} where T
431+
```
428432

429-
Now we cannot ignore the `T` in the Union (we must have T == Any), so `T` is not
433+
Now we cannot ignore the `T` in the `Union` (we must have `T == Any`), so `T` is not
430434
concrete and the answer is "true".
431435
That would make the concreteness of `T` depend on the other type, which is not
432436
acceptable since a type must have a clear meaning on its own.
@@ -476,8 +480,8 @@ A good way to start is to watch subtyping in action.
476480
Build Julia with `make debug` and fire up Julia within a debugger.
477481
[gdb debugging tips](@ref) has some tips which may be useful.
478482

479-
Because the subtyping code is used heavily in the REPL itself--and hence breakpoints in this
480-
code get triggered often--it will be easiest if you make the following definition:
483+
Because the subtyping code is used heavily in the REPL itself -- and hence breakpoints in this
484+
code get triggered often -- it will be easiest if you make the following definition:
481485

482486
```julia-repl
483487
julia> function mysubtype(a,b)

0 commit comments

Comments
 (0)