Skip to content

doc(inline specialisation): typos and improvements #8247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/docs/reference/metaprogramming/inline.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ obj2.meth() // OK
Here, the inline method `choose` returns an object of either of the two dynamic types
`A` and `B`. If `choose` had been declared with a normal return type `: A`, the result
of its expansion would always be of type `A`, even though the computed value might be
of type `B`. The inline method is "blackbox" in the sense that details of its
of type `B`. The inline method is a "blackbox" in the sense that details of its
implementation do not leak out. But with the specializing return type `<: A`,
the type of the expansion is the type of the expanded body. If the argument `b`
is `true`, that type is `A`, otherwise it is `B`. Consequently, calling `meth` on `obj2`
type-checks since `obj2` has the same type as the expansion of `choose(false)`, which is `B`.
Inline methods with specializing return types are "whitebox" in that the type
Inline methods with specializing return types are a "whitebox" in the sense that the type
of an application of such a method can be more specialized than its declared
return type, depending on how the method expands.

Expand Down