Skip to content

Commit 5e38d1d

Browse files
committed
Correct a typo and improve some text
1 parent 05e10ca commit 5e38d1d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

text/0000-type-ascription.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ let x: T = {
8787
};
8888
8989
// With type ascription.
90-
let x: T foo(): U<_>;
90+
let x: T = foo(): U<_>;
9191
```
9292

9393

@@ -117,13 +117,14 @@ expression are exactly those of the implicit coercion.
117117
### coercion and `as` vs `:`
118118

119119
A downside of type ascription is the overlap with explicit coercions (aka casts,
120-
the `as` operator). Type ascription makes implicit coercions explicit. In RFC
121-
401, it is proposed that all valid implicit coercions are valid explicit
122-
coercions. However, that may be too confusing for users, since there is no
123-
reason to use type ascription rather than `as` (if there is some coercion).
124-
Furthermore, if programmers do opt to use `as` as the default whether or not it
125-
is required, then it loses its function as a warning sign for programmers to
126-
beware of.
120+
the `as` operator). To the programmer, type ascription makes implicit coercions
121+
explicit (however, the compiler makes no distinction between coercions due to
122+
type ascription and other coercions). In RFC 401, it is proposed that all valid
123+
implicit coercions are valid explicit coercions. However, that may be too
124+
confusing for users, since there is no reason to use type ascription rather than
125+
`as` (if there is some coercion). Furthermore, if programmers do opt to use `as`
126+
as the default whether or not it is required, then it loses its function as a
127+
warning sign for programmers to beware of.
127128

128129
To address this I propose three lints which check for: trivial casts, coercible
129130
casts, and trivial numeric casts. Other than these lints we stick with the

0 commit comments

Comments
 (0)