1. 07 1月, 2015 16 次提交
    • A
      VB CLSComplianceChecker: Visit declaration in each module separately to avoid... · 817593d9
      AlekseyTs 提交于
      VB CLSComplianceChecker: Visit declaration in each module separately to avoid dealing with merged namespaces. Merged namespaces do not have containing module, which was causing a NullReferenceException.
      ***NO_CI***
       (changeset 1389009)
      817593d9
    • J
      The basic change here is the following · 871a3d8d
      jaredpar 提交于
      1. Remove CancellationToken from AsyncQueue<T> constructor. This type is not an async operation, nor does it have the concept of cancellation, hence it doesn't really make sense to have a CancellationToken as parameter. Caller is now responsible for handling cancellation
      2. The SetException, Completed and Enqueue methods are inherently racy methods. Added a Try variant of all methods which returns false on failure. The non-Try variants will throw on failure.
      3. Separated out the cancellation portion of DequeueAsync. This simplified the rest of the logic in the type and allowed us to remove WaiterTaskArguments as there is no longer a race on completing the TaskCompletionSource. This is an internal implementation detail only.
      4. Added a series of unit tests to codify the behavior as I understand it after discussions with Neal.
      
      ***NO_CI***
       (changeset 1388936)
      871a3d8d
    • N
      nameof spec change - extension methods not supported · c152e330
      nmgafter 提交于
      The spec for how nameof should work in the face of extension methods is not really worked out, and the implementation is hacky and unlikely to align with an eventual rational specification. So we've decided to make it an error today so we can work out and implement some intentional rational behavior in the future without breaking backward compatibility. Nobody seems to use this particular intersection of features anyway. (changeset 1388917)
      c152e330
    • A
      Remove too aggressive assert. · 39350631
      AlekseyTs 提交于
      ***NO_CI***
       (changeset 1388887)
      39350631
    • T
      fd5df00b
    • T
      Marks CSharpKind and VBKind extension methods as Obsolete and adds equivalent... · 2c00ec7e
      TomasMatousek 提交于
      Marks CSharpKind and VBKind extension methods as Obsolete and adds equivalent extension methods Kind for both languages.
      Marks CSharpKind and VBKind instance methods on language specific syntax nodes Obsolete as well. (changeset 1388816)
      2c00ec7e
    • T
      Allow PE and PDB streams to be arbitrary writable streams. If the specified... · 27a12a39
      TomasMatousek 提交于
      Allow PE and PDB streams to be arbitrary writable streams. If the specified stream doesn't fulfill implementation specific requirements of the PE/PDB writer use an intermediate in-memory stream and write its content to the user specified one at the end of emit.
      
      Fixes #349.
       (changeset 1388751)
      27a12a39
    • N
      Conversions for interpolated strings v8 · bbbbe68d
      nmgafter 提交于
      We also add all of the relevant optimizations requested for current and future
      formatting performance improvements. We now use full overload resolution
      (using a new binder type specialized for synthesizing invocations) to
      select an appropriate string.Format method or format factory method, which
      enables it to handle params, generics, arbitrary argument conversions, etc, and we
      optimize the special case of no fill-ins by processing the {{ and }} escapes,
      producing a literal in the generated code. (changeset 1388224)
      bbbbe68d
    • V
      Bug fixes for index intializers. · 40898dd1
      VSadov 提交于
      Index expressions in the index initializers should be evaluated exactly once.
      In a case of a nested initializer, we were evaluating as many times as we have members in the RHS. That resulted in a number of bugs reported.
      
      Working on this fix revealed some more issues with params and named indices not being supported properly.
      
      Fixes #449
       (changeset 1388102)
      40898dd1
    • T
      Fixes a couple of issues encountered while running tests in 64bit environment: · 30b18984
      TomasMatousek 提交于
      Bug 1022828: Buffer overrun in PdbWriter - off-by-one error, we were writing to the SymWriter's stack beyond a reserved buffer.
      EnC apply tests can run 32bit.
      Resource tests were incorrectly converting a pointer to 32bit integer. (changeset 1387932)
      30b18984
    • V
      Added testts to verify static lambda serialization when building Debug · 02a64708
      VSadov 提交于
      ***NO_CI***
       (changeset 1387571)
      02a64708
    • V
      b9aac8d4
    • P
      Allow range variables to be considered for Color Color. · 499cb88d
      pgavlin 提交于
      This is consistent with the spec and Dev12.
      ***NO_CI***
       (changeset 1387266)
      499cb88d
    • A
      C#: Disallow field-like event initializers in structs. Fixes #343. · b168a821
      AlekseyTs 提交于
      ***NO_CI***
       (changeset 1387165)
      b168a821
    • T
      Make sure we use the same CodeAnalysisRuleSet across all configurations of a... · a448383f
      tmeschter 提交于
      Make sure we use the same CodeAnalysisRuleSet across all configurations of a project. (changeset 1387120)
      a448383f
    • V
      Updating the toolset compiler. · 1c0d0ac8
      VSadov 提交于
      ***NO_CI***
       (changeset 1386846)
      1c0d0ac8
  2. 24 12月, 2014 24 次提交
    • P
      Ensure that GetSemanticInfo() returns the correct members for the LHS of a... · 836df4a4
      pgavlin 提交于
      Ensure that GetSemanticInfo() returns the correct members for the LHS of a conditional access expression.
      
      The syntax node for the LHS of a conditional access expression appears in two places:
      - Inside its own BoundExpression, tracked by BoundConditionalAccess.Receiver
      - Inside the BoundConditionalReceiver that is attached to the RHS of the conditional access expression, tracked by BoundConditionalAccess.AccessExpression
      
      Or, diagramatically (let "SyntaxNode" be the syntax node for the LHS of the conditional access expression):
      
            BoundConditionalAccessExpression
            /                              \
      BoundExpression                    .....
            |                              |
        SyntaxNode               BoundConditionalReceiver
                                           |
                                       SyntaxNode
      
      This has the effect of confusing the semantic model when looking for symbol information for SyntaxNode: because the appearance of SyntaxNode in the RHS of the BoundConditionalAccessExpression is lower in the bound tree than the appearance of SyntaxNode in the LHS, the BoundConditionalReceiver associated with the RHS will be used to lookup symbols. The primary effect of this is a failure to return the actual method called in situations such as the following:
      
      class C
      {
          public int I;
      
          public static C M(long l) { return null; }
          public static C M(int i) { return null; }
      
          public static int Main()
          {
              return (int)(M(0)?.I);
          }
      }
      
      If semantic information is requested for "M" in the call to "M(0)", the returned information will contain both overloads of "M" instead of the actual overload chosen.
      
      The actual fix is simple:
      - Mark all BoundConditionalReceiver nodes as compiler generated, thus eliminating them from consideration for MemberSemanticModel.GetBoundNodes
      - Stop digging through the syntax tree for conditional expressions when getting the bindable parent node of an expression
      
      Unfortunately, the recommendation service took a dependency on seeing the BoundConditionalReceiver in the tree when requesting type information for the bound LHS of a member binding expression via SemanticModel.GetTypeInfo: if the type of the original receiver for the conditional access is T?, the type of the BoundConditionalReceiver is T. Instead of relying on this behavior, the recommendation service has been updated to perform this transformation manually.
      ***NO_CI***
       (changeset 1386679)
      836df4a4
    • M
      Fix for bug 1096385: Remove unimplemented warnings from csc\vbc that were kept for compat reasons · 72549ff8
      manishv 提交于
      There are some warnings that we havent implemented in Roslyn but have kept around because someone could have done a /nowarn and we would have complained in the past if we didnt recognize that warning number.
      
      However now that /nowarn doesnt complain about unrecognized warnings (because it needs to support userdiags) there's no point keeping them. (changeset 1386659)
      72549ff8
    • M
      Fix for bug 1095705: The analyzer driver makes duplicate callbacks for... · 3052d341
      manishv 提交于
      Fix for bug 1095705: The analyzer driver makes duplicate callbacks for FieldDeclarationSyntax nodes (https://roslyn.codeplex.com/workitem/462)
      
      We ended up making duplicate callbacks for field declarations for syntax analyzers, as the declaring node for the decl is the variable declarator within the field declaration. Fix is to make sure that we compute the topmost node used for syntax analysis for declarations.
      
      Fixes codeplex issue 462. (changeset 1386620)
      3052d341
    • A
      Simplify updating LKG compiler & analyzers by introducing "global" NuGet references · 9ee65cac
      angocke 提交于
      This changeset introduces the concept of a "global" nuget package. The references to the NuGet packages are inserted into the Open VSL.Settings.targets file, which is imported into every project in Roslyn. This ensures that every project automatically gets these "global" packages. (changeset 1386548)
      9ee65cac
    • K
      Fix the build to work well under OSS conditions. · 026a0382
      KevinRansom 提交于
      Mainly:
      1.   disables some tests that fail in the OSS branch.
      2.   Fakesigns the diagnostics implementation assemblies
      3.   Fakesign the TestResourcesProprietary dll, which is deployed via nuget. (changeset 1386520)
      026a0382
    • A
      Anonymous Type.ToString() implementation should use overload of String.Format... · c631286d
      AlekseyTs 提交于
      Anonymous Type.ToString() implementation should use overload of String.Format that takes IFormatProvider. Also, C# implementation should explicitly call Object.ToString on each property value before passing it to the Format function, this ensures compatibility with code generated by native compiler.
      ***NO_CI***
       (changeset 1386476)
      c631286d
    • T
      EnC: Fixes synthesized member merging. The previous impl didn't handle case of... · 3c135233
      TomasMatousek 提交于
      EnC: Fixes synthesized member merging. The previous impl didn't handle case of adding non-syntheszed member after updating a method that generates a synthesized type (state machine). (changeset 1386078)
      3c135233
    • N
      0741ab9b
    • V
      Change exception filter keyword if ----> when. · 1ff04c56
      VSadov 提交于
      ***NO_CI***
       (changeset 1385867)
      1ff04c56
    • P
      Issue warning CS0628 for protected constructors inside of sealed classes. · f82be7f5
      pgavlin 提交于
      This brings us back on par with Dev12.
      ***NO_CI***
       (changeset 1385660)
      f82be7f5
    • T
      Updates System.Collections.Immutable and System.Metadata.Reader to versions... · e8be04b7
      TomasMatousek 提交于
      Updates System.Collections.Immutable and System.Metadata.Reader to versions 1.1.33-beta and 1.0.18-beta, respectively.
           Updates VSMEF to the latest build from VSPRO_1.
      
           A few code fixes:
           - ImmutableArrayInterop is gone
             - in product we used in a couple of places where we now just create a copy of the byte[] (MetadataWriter)
             - test infrastructure uses a workaround with explicitly laid out union to avoid copies of large metadata blobs
           - EditorTestApp class was incorrectly importing MEF components resulting in a cycle. The new VSMEF reports such errors. (changeset 1385613)
      e8be04b7
    • P
      Change Color Color handling to use binding instead of lookup. · 92b896ba
      pgavlin 提交于
      The Color Color handling in the binder originally used lookup to decide the meaning of an ambiguous identifier as a simple name or type name instead of binding. This was done for two reasons:
      - Binding is more expensive than lookup
      - Binding may have side effects that are undesirable depending on how the Color Color binding is ultimately resolved
      
      Unfortunately, this is not correct: the meaning of an identifier as outlined in the spec is defined by binding. This caused the compiler to incorrectly fail to recognize Color Color in situations where a simple name or type name lookup is ambiguous but a bind of the same is not. This change replaces the lookups used in Color Color with binds, which brings Roslyn's behavior back in line with Dev12 and the spec in cases that fit such cases.
      
      This change is likely to be slightly perf-positive in cases involving a simple name that does not bind to a symbol that qualifies for the Color Color rule: in this case, the old code performed a lookup followed by a bind, whereas the new code simply performs a bind and returns the result. There is likely to be a perf penalty in a true Color Color case, however, as the bound node is larger and the new code is unconditionally binding the type even in the case where the type will not be used (whereas the old code would simply look up the type).
      ***NO_CI***
       (changeset 1385215)
      92b896ba
    • M
      Fix for bug 1094337: Remove /option switch in command line compilers and... · 5566daaf
      manishv 提交于
      Fix for bug 1094337: Remove /option switch in command line compilers and remove global options and culture on AnalyzerOptions
      
      Remove "/option" command line switch added for custom key-value pair analyzer options. There is no way to specify these options in the msbuild project file, so we will just revert the command line support and add it back once the end-to-end scenario is implemented for analyzer options.
      
      Additionally, also remove the Culture passed into the analyzer options. Diagnostic analyzer authors need not report localized diagnostics, just localizable diagnostics, which can be localized for any given culture by the analyzer host (IDE/command line compiler). (changeset 1384781)
      5566daaf
    • A
      C#: Do not bind constructor initializer for an “external” constructor, report... · ff62c71d
      AlekseyTs 提交于
      C#: Do not bind constructor initializer for an “external” constructor, report an error if constructor initializer is present in code. This prevents unexpected diagnostics. Fixes #386.
      ***NO_CI***
       (changeset 1384736)
      ff62c71d
    • N
    • A
      Metadata: associate custom attributes with correct rows in generic parameters... · ade83e7b
      AlekseyTs 提交于
      Metadata: associate custom attributes with correct rows in generic parameters metadata table. Fixes #121. (changeset 1384436)
      ade83e7b
    • T
      Add an overload of EmitDifferent that doesn't take isAddedSymbol - we only... · 659fead1
      TomasMatousek 提交于
      Add an overload of EmitDifferent that doesn't take isAddedSymbol - we only need isAddedSymbol temporarily until CLR bug 1094313 is fixed. It will be simpler to remove/obsolete the overload once it's not needed. (changeset 1384161)
      659fead1
    • T
      Allows adding members of any visibility during debugging session. · 3de74bcb
      TomasMatousek 提交于
      Due to CLR bug 1094313 the added members can't be referenced from another assembly. For now we report a rude edit if we detect a MemberRef or TypeRef to a symbol added during debugging.
       (changeset 1384081)
      3de74bcb
    • T
      The symbol matcher wasn't correctly handling TypeRefs: it mapped their... · 4f170110
      TomasMatousek 提交于
      The symbol matcher wasn't correctly handling TypeRefs: it mapped their containing assembly to the same assembly as the target assembly.
      
      Instead it should map source modules from all generations to the target assembly and keep other modules unmapped. (changeset 1384022)
      4f170110
    • P
      Fix a crash that occurs when lowering await expressions with dynamically-typed results. · 71b71689
      pgavlin 提交于
      The await rewriter was attempting to manually replace "dynamic" with "object" in an expression's awaiter type and related methods for await expressions that are typed as "dynamic". Not only is this unnecessary--this sort of rewrite will be done at emit time--it is also incorrect given the pattern-based nature of await binding.
      
      I also simplified the code that finds and validates the various methods and types needed for an await expression while making this fix.
      ***NO_CI***
       (changeset 1383986)
      71b71689
    • N
      1090472-Ensure retargeted error symbols cause use-site errors · 84685f57
      nmgafter 提交于
      Also includes VB implementation
       (changeset 1383936)
      84685f57
    • A
      C# Method Type Argument Inference - Implement tie-breaker between object and... · 75c73cc1
      AlekseyTs 提交于
      C# Method Type Argument Inference - Implement tie-breaker between object and dynamic types. Fixes #56.
      ***NO_CI***
       (changeset 1383703)
      75c73cc1
    • J
      A watson bug from TFS CodeLens components revealed two issues in the parser: · 0ae3e7fa
      jaredpar 提交于
           1. The recursive parsing of statements, which occurs in delegate declarations or nested blocks, didn't have the same stack overflow guard that recursive expressions had.
           2. The parser was subject to unnecessary recursion in mismatched brace scenario which lead to deep recursion when combined with delegate declarations
      
           A concrete example of the second issue is the following:
      
             class C {
               void Test() {  // No closing }
               delegate void D1();
               delegate void D2();
             }
      
           In the above scenario both D1 and D2 will be parsed as delegate statement expressions and not delegate declarations.  In files with a large number of delegates, common in generated code, this quickly lead to a stack overflow scenario.
      
           Our guards sufficiently protect us from a crash here however the editing experience is very poor.  Once a stack guard is hit the parser essentially gives up on the remainder of the file.  This meant a simple mismatched brace could kill the editing experience in a file.  Discussed this with Neal and we decided the appropriate fix here was to not recurse into a delegate declaration if it lacked the opening {.
      ***NO_CI***
       (changeset 1383579)
      0ae3e7fa
    • N
      interpolated string revision per LDM decisions · 64570b21
      nmgafter 提交于
      still outstanding is the target-type conversion to FormattableString and IFormattable. (changeset 1383442)
      64570b21