- 07 5月, 2014 28 次提交
-
-
由 manishv 提交于
Address code review feeedback for changeset 1251270 (Add "CustomTags" property to DiagnosticDescriptor and Diagnostic types) (changeset 1251448)
-
由 AlekseyTs 提交于
Adjusted conditions under which using statement target should be parsed as an expression. Fixes https://roslyn.codeplex.com/workitem/11. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/8903c0ed35c40f5ff3354e30b996a862d736192b. (changeset 1251406)
-
由 shyamn 提交于
Fixes VB data flow analysis to stop reporting 'unused variable' errors for variables that the compiler synthesizes when the code contains syntax errors. For example, VB reports bogus (Unused variable '') error for the following code - Module Module1 Sub Main Dim End Sub End Module Current fix is to suppress the error if the variable has an empty name. Also added a test + fixed up couple of tests that were relying on the bad error. (changeset 1251396)
-
由 jasonmalinowski 提交于
We had some cases where we were build against different MSBuild assemblies from different versions from MSBuild. This caused runtime errors when we tried to run tests. (changeset 1251361)
-
由 AlekseyTs 提交于
Add support for declaration expressions in constructor initializer. Fixes https://roslyn.codeplex.com/workitem/6. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/36e1c380c3caffdc1c0978a23308b4c4a5a7bf77. (changeset 1251337)
-
由 manishv 提交于
Add "CustomTags" property to DiagnosticDescriptor and Diagnostic types. This will enable DiagnosticAnalyzers to generate diagnostics with custom tags providing additional metadata information about the diagnostic. (changeset 1251270)
-
由 YingP99 提交于
-
由 AlekseyTs 提交于
A Declaration Expression should not be treated as a primary-expression by the language parser. Fixes https://roslyn.codeplex.com/workitem/18. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/d5f905aefda0b465c8e32d990430f5da5ecdeb45. (changeset 1251223)
-
由 Kevin_H 提交于
-
由 dpoeschl 提交于
If an open file is a linked file and that document or its project is unloaded, then we determine the new active context document for that linked file and switch the context. Following the same process during solution close may fail because the host document for the new active context document may have already been removed. There is no need to set the updated document context during solution close so we now skip this step in that case. (changeset 1251204)
-
由 srivatsn 提交于
Implementing Equals and GetHashCode on AnalyzerFileReference instead of AnalyzerReference since reference equality makes sense for other AnalyzerReferences. (changeset 1251164)
-
由 Kevin_H 提交于
Provide option to opt-in to deterministic (non-zero) timestamp using "/features:deterministic". (changeset 1250882)
-
由 AlekseyTs 提交于
Ensure each lambda, including an implicit lambda in a query expression, has its own scope for declaration expressions within it. Fixes https://roslyn.codeplex.com/workitem/2. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/e79e272450264fb41a2f7f39b3fbaf3a0e73021b. (changeset 1250867)
-
由 ChuckStoner 提交于
Enumerate the set of top-level and nested types in the base PeWriter class. (changeset 1250804)
-
由 jeremymeng 提交于
-
由 chandera 提交于
-
由 chandera 提交于
-
由 AlekseyTs 提交于
Enable assignment to a declaration expression. Fixes https://roslyn.codeplex.com/workitem/18. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/0d51dfd01a7ff479cdae0bb90837dfa3770e6562. (changeset 1250584)
-
由 AlekseyTs 提交于
Report ERR_MethodArgCantBeRefAny for “out var” declarations without initializers. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/4b562c0061233f3e3a76de510ecd68b2d37fa1b1. (changeset 1250556)
-
由 AlekseyTs 提交于
Report name collision for “out var” declarations without initializers. Fixes http://roslyn.codeplex.com/workitem/42. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/c8c365cfa05594119a2bf4d269fbf23b2ae51d33. (changeset 1250509)
-
由 AlekseyTs 提交于
Improve CS0523 error message for backing fields of primary constructor parameters. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/2e28a89593fe4941209c87215855e5ae08775da2. (changeset 1250498)
-
由 TomasMatousek 提交于
Factor generating of custom debug information to a separate class. Remove mutable state from PEWriter related to custom debug info generation. (changeset 1250467)
-
由 AlekseyTs 提交于
Report an error if an argument list is provided for an implemented interface. Fixes https://roslyn.codeplex.com/workitem/4. This is a port of https://roslyn.codeplex.com/SourceControl/changeset/f930b49714dc268a0e9df96d213d5516634a6450. (changeset 1250419)
-
由 shyamn 提交于
interface I { static void M(this object o); } Result: (3,17): error CS0106: The modifier 'static' is not valid for this item (3,17): error CS1105: Extension methods must be static Expected: (3,17): error CS0106: The modifier 'static' is not valid for this item (3,17): error CS1106: Extension method must be defined in a non-generic static class The fix was simple - I simply switched the order in which the above extension method errors are reported. However, this has a small side-effect in that it changes the error reporting for the following case. The change seems acceptable (i.e. user would anyways have hit the new error that we report now as soon as they fixed the error that the old compiler was reporting in this case). I've fixed up the couple of tests that were validating the old error for this case. class C { void M(this object o) { } } Old (Native as well as Roslyn): Test.cs(3,10): error CS1105: Extension method must be static New: Test.cs(1,7): error CS1106: Extension method must be defined in a non-generic static class (changeset 1250408)
-
由 srivatsn 提交于
-
由 YingP99 提交于
Bug 687246: fix NumberStyles overlooked in previous checkin (thanks Chuck found out) (changeset 1250362)
-
由 YingP99 提交于
Bug fix (923303): check null parameter and throw for API - GetAnnotations(...) (changeset 1250335)
-
由 nslottow 提交于
The analyzers for CA1309, CA2213, CA2214, CA2200 were all calling GetSymbolInfo earlier and/or more often than they needed to and were slowing down analysis. This change adds checks before the offending calls to GetSymbolInfo. This also corrects the behavior of the CA2214 analyzer, which was previously producing warnings for all virtual methods called from within a constructor, not just for virtual methods defined in the class containing the constructor. (changeset 1250296)
-
- 06 5月, 2014 5 次提交
-
-
由 AlekseyTs 提交于
Migrated state of “Declaration Expressions” implementation equivalent to https://roslyn.codeplex.com/SourceControl/changeset/b7fd08a5695e21cd4d23b8b70815c53656dab65f. (changeset 1249879)
-
由 TomasMatousek 提交于
Use ImmutableArray instead if IEnumerable. (changeset 1249786)
-
由 AlekseyTs 提交于
Migrated state of “Primary Constructors” implementation equivalent to https://roslyn.codeplex.com/SourceControl/changeset/af3db25146a74523fbb2cf11ef00ddec6c0c3690. (changeset 1249690)
-
由 TomasMatousek 提交于
In C# lowering of async method stored the state machine type on SourceMethodSymbol so it can later be used when emitting synthesized attributes of the method. This may cause issues when emitting the same compilation twice with different options that affect the state machine type. Instead we should store the state machine type to the current PEModuleBuilder. Rather then actually storing it there and adding a dependency on PEModuleBuilder to the attribute generation this change introduces ModuleCompilationState (similar to TypeCompilationState) and threads that one. This type is designed to be mutable during compilation (lowering) and immutable during emit. The idea is that all data currently stored in PEModuleBuilder that are produced during compilation and only read in emit could be moved there. Only emit specific data would remain on PEModuleBuilder. Also refactors Compilation.Compile to remove some duplication and make it cleaner. (changeset 1249664)
-
由 VSadov 提交于
Change Description: Implementation of conditional access operators ( ?. and ?[] ) The grammar roughly looks like: expr ::= | ... | expr ? tail tail ::= | tailopt . id tail ::= | tailopt .$ id <--- this is NYI in this change | tailopt [ expr-args ] | tail ( expr-args ) Note that the tail isn’t optional for invocation: there is no ?(…) operator. Interesting implementation points: == Parsing/syntax Syntax tree is right associative – it has the same topology as in the grammar. However I did not create special variants for all the kinds of syntax that could be produced by the parsing of the tail of accessors. I just use regular syntax nodes with exception of the topmost node that is the conditional access operator itself and the lower-leftmost node that textually starts the accessor tail. The root node looks like – ConditionalAccessExpression { ExpressionSyntax Expression; SyntaxToken OperatorToken; // always “?” ExpressionSyntax WhenNotNull; // by analogy with conditional expression which uses WhenTrue } WhenNotNull is an ExpressionSyntax that represent the sequence of postfix operations conditionally applied to the Expression. These are regular InvocationExpressions, MemberAccesses, ElementAcesses – whatever postfix operators we have. The only special part about WhenNotNull is that the low-leftmost expression child is one of 2 special “binding” nodes – MemberBindingExpression, ElementBindingExpression. Binding expressions are entities which can start the chain of WhenNotNull . Textually they look like - “ .SimpleName“ , “[argList]” or “$Name” (when $ accessor is supported). Note that there is no InvocationBinding, since we do not allow () to start the chain of applications – you cannot do “a?(arg)”. The binding expression syntaxes are basically versions of corresponding member/element/dollar access expressions without receivers. R?.a.b(x).c Would parse as ConditionalAccess / | \ R ? MemberAccess / | \ Invocation . c / \ MemberAccess ArgList{( x )} / | \ MemberBinding . b | \ . a The advantage of using regular syntax nodes on the right side is that semantical analysis “just works”. Naturally, because of the topology, the API cannot ask nonsensical questions like - what is the type of subexpression “R?.a.b” ? Since “R?.a.b” is not a subexpression, there is no way to ask such question. It is however possible to interrogate member accesses – they are just regular member accesses (in both syntax and bound trees) so they naturally know their types etc… == Binding Binding of the tree above is fairly simple – I only had to add binding support for the left-lowermost binding nodes. And what comes out is really just regular access expressions with placeholder receiver. I cannot refer to the actual receiver since we are not evaluating it again. In terms of schema - Bound tree actually needed even fewer changes than syntax tree – the bound tree for the above expression is just a regular bound tree. It is isomorphic to the syntax. The only new bound nodes are the root BoundConditionalAccess and the left-lowermost placeholder receiver – BoundConditionalReceiver. BoundConditionalAccess / \ <BoundExpr> BoundMemberAccess {c} / BoundCall {b} / \ BoundMemberAccess {a} List<Args>{ x } / BoundConditionalReceiver == Dataflow Dataflow considers BoundConditionalReceiver always assigned. However the whole WhenNotNull is reachable conditionally - i.e. assignedVariables state is forked when going into WhenNotNull. “receiver is a const” situation is handled trivially. That is similar to the ?? operator but somewhat inverted. == Emit There are two ways to emit this : - In complex cases (nullables, async, expr trees) we lower the conditional access into a ternary with consequence being rewritten as0is with just BoundConditionalReceiver replaced by a temp for the receiver value. - In simple case (all reference types), we do not lower the node, emit of BoundConditionalAccess dups the receiver (thus avoiding an IL temp) , checks it for null and conditionally executes the the access expression. BoundConditionalReceiver is handled by emit by not emitting anything since it represents receiver value and that is on the stack already. (changeset 1249636)
-
- 05 5月, 2014 1 次提交
-
-
由 AlekseyTs 提交于
Migrated state of “Declaration Expressions” implementation equivalent to https://roslyn.codeplex.com/SourceControl/changeset/b7fd08a5695e21cd4d23b8b70815c53656dab65f. (changeset 1249879)
-
- 04 5月, 2014 1 次提交
-
-
由 TomasMatousek 提交于
Use ImmutableArray instead if IEnumerable. (changeset 1249786)
-
- 03 5月, 2014 5 次提交
-
-
由 AlekseyTs 提交于
Migrated state of “Primary Constructors” implementation equivalent to https://roslyn.codeplex.com/SourceControl/changeset/af3db25146a74523fbb2cf11ef00ddec6c0c3690. (changeset 1249690)
-
由 TomasMatousek 提交于
In C# lowering of async method stored the state machine type on SourceMethodSymbol so it can later be used when emitting synthesized attributes of the method. This may cause issues when emitting the same compilation twice with different options that affect the state machine type. Instead we should store the state machine type to the current PEModuleBuilder. Rather then actually storing it there and adding a dependency on PEModuleBuilder to the attribute generation this change introduces ModuleCompilationState (similar to TypeCompilationState) and threads that one. This type is designed to be mutable during compilation (lowering) and immutable during emit. The idea is that all data currently stored in PEModuleBuilder that are produced during compilation and only read in emit could be moved there. Only emit specific data would remain on PEModuleBuilder. Also refactors Compilation.Compile to remove some duplication and make it cleaner. (changeset 1249664)
-
由 VSadov 提交于
Change Description: Implementation of conditional access operators ( ?. and ?[] ) The grammar roughly looks like: expr ::= | ... | expr ? tail tail ::= | tailopt . id tail ::= | tailopt .$ id <--- this is NYI in this change | tailopt [ expr-args ] | tail ( expr-args ) Note that the tail isn’t optional for invocation: there is no ?(…) operator. Interesting implementation points: == Parsing/syntax Syntax tree is right associative – it has the same topology as in the grammar. However I did not create special variants for all the kinds of syntax that could be produced by the parsing of the tail of accessors. I just use regular syntax nodes with exception of the topmost node that is the conditional access operator itself and the lower-leftmost node that textually starts the accessor tail. The root node looks like – ConditionalAccessExpression { ExpressionSyntax Expression; SyntaxToken OperatorToken; // always “?” ExpressionSyntax WhenNotNull; // by analogy with conditional expression which uses WhenTrue } WhenNotNull is an ExpressionSyntax that represent the sequence of postfix operations conditionally applied to the Expression. These are regular InvocationExpressions, MemberAccesses, ElementAcesses – whatever postfix operators we have. The only special part about WhenNotNull is that the low-leftmost expression child is one of 2 special “binding” nodes – MemberBindingExpression, ElementBindingExpression. Binding expressions are entities which can start the chain of WhenNotNull . Textually they look like - “ .SimpleName“ , “[argList]” or “$Name” (when $ accessor is supported). Note that there is no InvocationBinding, since we do not allow () to start the chain of applications – you cannot do “a?(arg)”. The binding expression syntaxes are basically versions of corresponding member/element/dollar access expressions without receivers. R?.a.b(x).c Would parse as ConditionalAccess / | \ R ? MemberAccess / | \ Invocation . c / \ MemberAccess ArgList{( x )} / | \ MemberBinding . b | \ . a The advantage of using regular syntax nodes on the right side is that semantical analysis “just works”. Naturally, because of the topology, the API cannot ask nonsensical questions like - what is the type of subexpression “R?.a.b” ? Since “R?.a.b” is not a subexpression, there is no way to ask such question. It is however possible to interrogate member accesses – they are just regular member accesses (in both syntax and bound trees) so they naturally know their types etc… == Binding Binding of the tree above is fairly simple – I only had to add binding support for the left-lowermost binding nodes. And what comes out is really just regular access expressions with placeholder receiver. I cannot refer to the actual receiver since we are not evaluating it again. In terms of schema - Bound tree actually needed even fewer changes than syntax tree – the bound tree for the above expression is just a regular bound tree. It is isomorphic to the syntax. The only new bound nodes are the root BoundConditionalAccess and the left-lowermost placeholder receiver – BoundConditionalReceiver. BoundConditionalAccess / \ <BoundExpr> BoundMemberAccess {c} / BoundCall {b} / \ BoundMemberAccess {a} List<Args>{ x } / BoundConditionalReceiver == Dataflow Dataflow considers BoundConditionalReceiver always assigned. However the whole WhenNotNull is reachable conditionally - i.e. assignedVariables state is forked when going into WhenNotNull. “receiver is a const” situation is handled trivially. That is similar to the ?? operator but somewhat inverted. == Emit There are two ways to emit this : - In complex cases (nullables, async, expr trees) we lower the conditional access into a ternary with consequence being rewritten as0is with just BoundConditionalReceiver replaced by a temp for the receiver value. - In simple case (all reference types), we do not lower the node, emit of BoundConditionalAccess dups the receiver (thus avoiding an IL temp) , checks it for null and conditionally executes the the access expression. BoundConditionalReceiver is handled by emit by not emitting anything since it represents receiver value and that is on the stack already. (changeset 1249636)
-
由 ChuckStoner 提交于
EnC: MethodImpl entries should only be added if the implementing method was added (changeset 1249535)
-
由 kayleh 提交于
-