-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dotnet/master
updating personal fork to latest commit
- Loading branch information
Showing
2,291 changed files
with
121,578 additions
and
42,425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# EditorConfig is awesome: | ||
http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Default settings: | ||
# Use 4 spaces as indentation | ||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# Xml project files | ||
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] | ||
indent_size = 2 | ||
|
||
# Xml config files | ||
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ UnitTestResults.html | |
*.tmp | ||
*.tmp_proj | ||
*.log | ||
*.wrn | ||
*.vspscc | ||
*.vssscc | ||
.builds | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 | ||
msbuild /v:m /m BuildAndTest.proj /p:CIBuild=true | ||
if ERRORLEVEL 1 ( | ||
taskkill /F /IM vbcscompiler.exe | ||
echo Build failed | ||
exit /b 1 | ||
) | ||
|
||
REM Kill any instances of VBCSCompiler.exe to release locked files; | ||
REM otherwise future CI runs may fail while trying to delete those files. | ||
taskkill /F /IM vbcscompiler.exe | ||
|
||
REM It is okay and expected for taskkill to fail (it's a cleanup routine). Ensure | ||
REM caller sees successful exit. | ||
exit /b 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
COM interop | ||
=========== | ||
|
||
[This is a placeholder. We need some more documentation here] | ||
|
||
We have a number of features in the compiler/language to support COM interop, none of which is described in the language specification. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Definite Assignment For Partial And Conditional Methods | ||
======================================================= | ||
|
||
The C# language specification for definite assignment of an invocation expression [5.3.2.2] assumes incorrectly that the invocation expression and its arguments will be evaluated at runtime if it is reached. That may not be correct for *partial methods* [10.2.7] and methods marked with a *conditional attribute* [17.4.2]. | ||
|
||
The C# compiler correctly takes into account that the method invocation (and argument evaluation) may be omitted. | ||
|
||
```cs | ||
using System.Diagnostics; | ||
|
||
static partial class A | ||
{ | ||
static void Main() | ||
{ | ||
int x; | ||
x.Foo(); // OK | ||
Bar(x); // OK | ||
Bar(x = 1); | ||
x.ToString(); // error CS0165: Use of unassigned local variable 'x' | ||
} | ||
|
||
static partial void Foo(this int y); | ||
|
||
[Conditional("xxxxxx")] | ||
static void Bar(int y) { } | ||
|
||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Definite Assignment | ||
=================== | ||
|
||
The definite assignment rules for C# were reimplemented in Roslyn, and we discovered some shortcomings of the specification and native compiler, which we document here. | ||
|
||
### Constant boolean expressions | ||
|
||
There are two foundations definite assignment rules missing from the C# language specification, and from the implementation of definite assignment in the native compiler. Absence of these two rules causes a large number of cases of nonintuitive behavior of the compiler, and so the native compiler also includes a large number of ad-hoc rules to patch these examples. | ||
|
||
The Roslyn compiler implements the C# language specification with two additional foundational rules. With these rules added, the ad-hoc rules implemented by the native compiler are no longer needed. The new rules are more precise than those implemented by the native compiler; for example, the Roslyn C# compiler accepts the following code, but the native compiler rejects it: | ||
|
||
```cs | ||
static void Main(string[] args) | ||
{ | ||
int x; | ||
if (false && x == 3) | ||
{ | ||
x = x + 1; // Dev10 does not consider x definitely assigned | ||
} | ||
} | ||
``` | ||
|
||
The new foundational rules are: | ||
|
||
> #### 5.3.3.N Constant Expressions | ||
For a constant expression with value true: | ||
- If *v* is definitely assigned before the expression, | ||
then *v* is definitely assigned after the expression. | ||
- Otherwise *v* is “definitely assigned after false expression” | ||
after the expression. | ||
|
||
>For a constant expression with value false: | ||
- If *v* is definitely assigned before the expression, | ||
then *v* is definitely assigned after the expression. | ||
- Otherwise *v* is “definitely assigned after true expression” after the expression. | ||
|
||
>For all other constant expressions, the definite assignment state of *v* after the expression is the same as the definite assignment state of *v* before the expression. | ||
### Control transfers and intervening finally blocks | ||
|
||
The specification for definite assignment and reachability in the C# language specification do not properly take into account the possibility of "intervening" finally blocks between the origin of the control transfer and the destination. These finally blocks can assign to variables, this changing the definite assignment status, or change the control transfer behavior (e.g. by throwing an exception). Both the native compiler and the Roslyn C# compilers account for them in computing definite assignment and reachability of statements. |
Oops, something went wrong.