meetings/2021/LDM-2021-03-15.md
https://github.com/dotnet/csharplang/issues/4487
We looked at the open question around argument passing today. In the current form, the proposal treats the receiver specially, even for reduced extension methods where the receiver is just sugar for the first argument. This special treatment of the receiver is very limiting, as many API patterns exist today where destinations are conveyed as arguments to a method, not as the receiver of the method, and we would like APIs to be able to continue having their same shapes. It's also inconsistent with how we treat extension methods in the rest of the language: they're a sugar, and there is no semantic difference between calling them in reduced form or not.
To address this, we looked at a couple of possible solutions:
PrepFormat or similar signature that is isomorphic to the original signature, with the builder parameters
as out variables instead. This would allow us to simply call that signature, and there would be no fancy mapping to consider. However,
this is pretty messy from a public API standpoint. We can apply EditorDisplay to such methods, but they'll still exist, need to be
documented, and generally get in the way. It also means that every method will need to have a second method, which possibly limits code
sharing abilities.this or as a boolean flag.We'll look at the attribute on the builder type solution. The next question we need to answer is around out-of-order execution for arguments passed to builders.
https://github.com/dotnet/csharplang/issues/3428
Next, we looked at 2 open issues in global usings: the scope of the global using statements, and how name lookup treats these usings with respect to regular using directives. Both of these questions really hinge on the overall view we want to take on how global usings are represented. There are 2 views here:
using directives, and all the same
rules that apply to regular using directives at the top level apply to global usings as well.
using directive will never be changed by a global using directive.
Users can't introduce namespace ambiguities at the top level by introducing a global using directive that has a nested namespace with
the same name as a top-level namespace.using directive and a file-scoped using directive, that name is ambiguous.using directives at the top of a file. They are to file-scoped using
directives what file-scoped using directives are to using directives nested in a namespace.
#load directive change the
meaning of using directives in the current file, or files that are subsequently #loaded?using directives, only going to global directives if a name wasn't found.We think both worldviews here are consistent and reasonable, and would be fine with either mental model as an explanation to consumers of how the feature works. However, worldview 1 is more consistent with past decisions and has less implementation concerns.
We'll go with worldview 1. The decisions for scoping and name lookup fall out from this.