Version Used:
Visual C# 2017 RC 00369-50000-00000-AA881
Steps to Reproduce:
C#
var task = Task.Run(() => 1).ContinueWith(task => task.Result);
Expected Behavior
An error is reported
A local or parameter named 'task' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
Actual Behavior:
The code compiles and executes.
This may not be a bug; the "enclosing" symbol is a field, not a local.
This may not be a bug; the "enclosing" symbol is a field, not a local.
Something about this bothers me deeply. As far as the C# scripting language spec is concerned, that should stay an implementation detail, shouldn't it?
Yes, the fact that the script variable is backed by a field is an implementation detail. However, we may chose to allow this shadowing. Note that the C# scripting language spec doesn't exist yet.
Note that the C# scripting language spec doesn't exist yet.
Which is why I brought it up- since we're deviating from the C# language a bit, we will want one 馃槃
Also, the scripting language interfaces directly with Visual Studio projects and there are commands like send to interactive. It would be best for the language semantics to be as 1 to 1 as possible