Commit fe51fbe
docs: resolve the last open item on scope rules
Where a type parameter lands was listed as unconfirmed when reading
parse.cpp answers it. Foo[T]'s T is built with parse_ident_no_scope and
enters no scope at that point; it is collected and handed to
parse_indent_block, which pushes it into the body scope as the first
entry before any of the body is parsed. So T is visible throughout the
body without tripping the backward-only rule, is invisible outside the
format, and passes the only_type_allowed filter on the way out of a
nested scope because define_type_parameter is in is_type_ident.
Nothing is left unconfirmed. All three items the investigation opened
with were readable from the implementation and are now in the body.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 17a9919 commit fe51fbe
1 file changed
Lines changed: 29 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
176 | 203 | | |
177 | 204 | | |
178 | 205 | | |
| |||
188 | 215 | | |
189 | 216 | | |
190 | 217 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 218 | + | |
| 219 | + | |
0 commit comments