[Version 9.0] Feature support for top level statements#1454
Conversation
d872f61 to
07946a2
Compare
|
@BillWagner There is one grammar change: the extension of compilation_unit to allow |
| - The scope of a name defined by an *extern_alias_directive* ([§14.4](namespaces.md#144-extern-alias-directives)) extends over the *using_directive*s, *global_attributes*, *statement_list*s, and *namespace_member_declaration*s of its immediately containing *compilation_unit* or *namespace_body*. An *extern_alias_directive* does not contribute any new members to the underlying declaration space. In other words, an *extern_alias_directive* is not transitive, but, rather, affects only the *compilation_unit* or *namespace_body* in which it occurs. | ||
| - The scope of a name defined or imported by a *using_directive* ([§14.5](namespaces.md#145-using-directives)) extends over the *global_attributes*, *statement_list*s, and *namespace_member_declaration*s of the *compilation_unit* or *namespace_body* in which the *using_directive* occurs. A *using_directive* may make zero or more namespace or type names available within a particular *compilation_unit* or *namespace_body*, but does not contribute any new members to the underlying declaration space. In other words, a *using_directive* is not transitive but rather affects only the *compilation_unit* or *namespace_body* in which it occurs. |
There was a problem hiding this comment.
I just made these two edits (after working on the V10 feature "File-Scoped Namespaces," which further changes these two bullet items). Now that top-level statements (statement_lists) are permitted immediately before namespace_member_declarations, we need to make sure those statements are in the scope of these two directives.
b9bed76 to
197acef
Compare
197acef to
ade6460
Compare
Add support for top-level statements Add support for top-level statements fix md formatting tweak generated entry-point signature table Update basic-concepts.md Add mention of attribute System.Runtime.CompilerServices.CallerMemberName mention invoking method in top-level statement situation fix link
ade6460 to
db48965
Compare
|
An earlier version of this feature is already present on |
This PR contains the work for Top-level statements in C# 9.
The commits from #980 were squashed to the first commit on this branch.
The ANTLR grammar is failing. I admit I'm not sure why. There are no grammar changes in this PR.