- 20 3月, 2017 12 次提交
-
-
由 Jared Parsons 提交于
-
由 CyrusNajmabadi 提交于
Add "Add null checks" option when a user tries to generate a constructor from members.
-
由 Andy Gocke 提交于
Lambda rewriting currently allows frames to be structs in the instance where The variables in the frame are not captured by any closures converted to delegates. A closure nested inside the struct closure captures a separate variable that does require a class frame. This poses a problem when the "outer" closure is in the same frame as the variable that requires a class closure. The problem is that we treat scopes and frames as essentially the same thing -- if any scope is perceived to require a particular environment type, all captured variables in that scope will be captured on that frame and all closures will be lowered onto that frame. This creates a conflict between class-based environment capturing, where we want to capture the frame pointer as a field, and struct-based frame capturing, where we want to add arguments as ref parameters. Doing both results in breaking the delegate contract (no signature rewriting) or losing required struct arguments to intermediate closures. To elaborate on the problem here, let's consider the example: ```csharp using System; class C { public void M() { int x = 0; { int y= 0; void Local() { if (x == 0) { Action a = () => y++; a(); } } Local(); } } } ``` The current problem in the compiler is in the code now in GetStructClosures. The previous implementation only built struct closure if the closure was being lowered onto a struct frame. However, in the example, y is being captured by a lambda, meaning that y must be in a class frame. Since Local lives in the same scope it also lives in the same frame and contains the lambda capturing y, meaning that it must live in a class frame as well. Of course, it is not converted to a delegate, nor does it capture any variables that are captured by closures converted to delegates, so its signature is free to be rewritten to take variables which are not captured by closures converted to delegates as struct environment parameters. Here is the expected lowering for the previous example: ```csharp void M() { var env1 = new Env1(); env1.x = 0; var env2 = new Env2(); env2.y = 0; env2.<>_L(ref env1); } struct Env1 { public int x; } class Env2 { public int y; public void <>_L(ref Env1 env1) { if (env1.x == 0) { var env3 = new Env3(); env3.env2 = this; Action a = env3.<>_anon; a(); } } } class Env3 { Env2 env2; public void <>_anon() => this.env2.y++; } ``` The problem comes when calculating the struct frames needed to be passed to Local. In the current implementation, unless the "container" is a struct, no struct frames are added. If we fix that to check for struct frames that are required as parent frames, regardless of the type of container we run into another problem. In this case, the lambda also includes struct frames in its parent "context", but adding any struct frames to a closure that is converted to a delegate is incorrect. The previous problem can be solved by a check to see if the closure can take new ref parameters. This is true for all closures except for ones marked async or iterators or ones converted to delegates. This works because of something we already know from the analysis: if we assume that struct environments are only created when the their capturing closure can take ref parameters, we can assume that any struct environments in scope are "safe" to use, even if those frames are in the "parent context" of the closure. Fixes #16895
-
由 CyrusNajmabadi 提交于
-
由 CyrusNajmabadi 提交于
-
由 CyrusNajmabadi 提交于
-
由 CyrusNajmabadi 提交于
-
由 CyrusNajmabadi 提交于
-
由 CyrusNajmabadi 提交于
-
由 CyrusNajmabadi 提交于
-
由 CyrusNajmabadi 提交于
Document.TryGetSyntaxTree can return immediately if SyntaxTree was ca…
-
由 Andy Gocke 提交于
-
- 19 3月, 2017 4 次提交
-
-
由 Dirk Lellinger 提交于
-
由 David Poeschl 提交于
-
由 CyrusNajmabadi 提交于
-
由 CyrusNajmabadi 提交于
-
- 18 3月, 2017 3 次提交
-
-
由 Neal Gafter 提交于
* Forbid a void assignment to a discard. Fixes #17674 * Document the breaking change.
-
由 Jason Malinowski 提交于
Simplify AsyncLazy
-
由 Jason Malinowski 提交于
We were doing this previously, but in 39815975 had to move away from it because we needed to hold onto an additional struct. The reason for that is now gone, so we can go back to the pattern.
-
- 17 3月, 2017 5 次提交
-
-
由 Ivan Basov 提交于
Integration tests for CSharpInteractiveCommands
-
由 Ravi Chande 提交于
Have perf.runner configure benchview so internal test's don't have to
-
由 Ty Overby 提交于
* make sure that binary or operators aren't the same in different contexts * use ToTestDisplayString
-
由 Jared Parsons 提交于
Set VS toolset binaries to 32bitpref to workaround VS build bug
-
由 CyrusNajmabadi 提交于
Merge dev15.1.x to master
-
- 16 3月, 2017 16 次提交
-
-
由 Omar Tawfik 提交于
Add C# 7.1 version to compiler
-
由 Jason Malinowski 提交于
We previously had some complexity where we'd use TaskCompletionSource in an asynchronous manner by launching thread pool operations to complete tasks to prevent issues. .NET 4.6 has built-in support for this so we can just use it directly.
-
由 Andy Gocke 提交于
-
由 Jason Malinowski 提交于
These comments should have been deleted in f43398f3.
-
由 Omar Tawfik 提交于
-
由 Ty Overby 提交于
* add regression test for WithDocumentationMode * check values * jared nit
-
由 Andy Gocke 提交于
-
由 Andy Gocke 提交于
-
由 Andy Gocke 提交于
-
由 Jason Malinowski 提交于
Avoid deadlock on solution close with linked files
-
由 Heejae Chang 提交于
don't convert metadata reference to project reference. this workspace…
-
由 Neal Gafter 提交于
Related to #15885 Fixes #17683
-
由 AlekseyTs 提交于
Ensure LanguageParser.ParseStatement doesn’t return null.
-
由 Tomáš Matoušek 提交于
Use Microsoft.DiaSymReader.Converter.Xml 1.0.0-beta1-61515-01 - with signed dlls
-
由 Tomas Matousek 提交于
-
由 CyrusNajmabadi 提交于
VB parameter lists can be missing. Be resilient to that.
-