Repository: dotnet/roslyn
File: src/Compilers/CSharp/Portable/Symbols/AnonymousTypes/AnonymousTypeManager.cs (C#)

Code before:
{
    /// <summary>
    /// Manages anonymous types created in owning compilation. All requests for 
    /// anonymous type symbols go via the instance of this class.
    /// </summary>
    internal sealed partial class AnonymousTypeManager : CommonAnonymousTypeManager
    {
        internal AnonymousTypeManager(CSharpCompilation compilation)
        {
            Debug.Assert(compilation != null);
            this.Compilation = compilation;
        }

        /// <summary> 
        /// Current compilation
        /// </summary>
        public CSharpCompilation Compilation { get; }

        /// <summary>
        /// Given anonymous type descriptor provided constructs an anonymous type symbol.
        /// </summary>
        public NamedTypeSymbol ConstructAnonymousTypeSymbol(AnonymousTypeDescriptor typeDescr, BindingDiagnosticBag diagnostics)
        {
            if (diagnostics.AccumulatesDependencies)
            {
                var depencies = BindingDiagnosticBag.GetInstance(withDependencies: true, withDiagnostics: false);
                ReportMissingOrErroneousSymbols(depencies);
                diagnostics.AddRange(depencies);
                depencies.Free();
            }

            return new AnonymousTypePublicSymbol(this, typeDescr);
        }

        public NamedTypeSymbol ConstructAnonymousDelegateSymbol(AnonymousTypeDescriptor typeDescr)
        {
            // ReportMissingOrErroneousSymbols is not reporting anything for delegate types and
            // ReportMissingOrErroneousSymbolsForDelegates reports only Special types.
            // Therefore, we have no additional dependencies to report here.
            return new AnonymousDelegatePublicSymbol(this, typeDescr);
        }

        /// <summary>
        /// Get a symbol of constructed anonymous type property by property index
        /// </summary>
        internal static PropertySymbol GetAnonymousTypeProperty(NamedTypeSymbol type, int index)
        {
            Debug.Assert((object)type != null);
            Debug.Assert(type.IsAnonymousType);

            var anonymous = (AnonymousTypePublicSymbol)type;

Review comment (suggestion):

```suggestion
                var dependencies = BindingDiagnosticBag.GetInstance(withDependencies: true, withDiagnostics: false);
``` #Resolved

Code after:
{
    /// <summary>
    /// Manages anonymous types created in owning compilation. All requests for 
    /// anonymous type symbols go via the instance of this class.
    /// </summary>
    internal sealed partial class AnonymousTypeManager : CommonAnonymousTypeManager
    {
        internal AnonymousTypeManager(CSharpCompilation compilation)
        {
            Debug.Assert(compilation != null);
            this.Compilation = compilation;
        }

        /// <summary> 
        /// Current compilation
        /// </summary>
        public CSharpCompilation Compilation { get; }

        /// <summary>
        /// Given anonymous type descriptor provided constructs an anonymous type symbol.
        /// </summary>
        public NamedTypeSymbol ConstructAnonymousTypeSymbol(AnonymousTypeDescriptor typeDescr, BindingDiagnosticBag diagnostics)
        {
            if (diagnostics.AccumulatesDependencies)
            {
                var dependencies = BindingDiagnosticBag.GetInstance(withDependencies: true, withDiagnostics: false);
                ReportMissingOrErroneousSymbols(dependencies);
                diagnostics.AddRange(dependencies);
                dependencies.Free();
            }

            return new AnonymousTypePublicSymbol(this, typeDescr);
        }

        public NamedTypeSymbol ConstructAnonymousDelegateSymbol(AnonymousTypeDescriptor typeDescr)
        {
            // ReportMissingOrErroneousSymbols is not reporting anything for delegate types and
            // ReportMissingOrErroneousSymbolsForDelegates reports only Special types.
            // Therefore, we have no additional dependencies to report here.
            return new AnonymousDelegatePublicSymbol(this, typeDescr);
        }

        /// <summary>
        /// Get a symbol of constructed anonymous type property by property index
        /// </summary>
        internal static PropertySymbol GetAnonymousTypeProperty(NamedTypeSymbol type, int index)
        {
            Debug.Assert((object)type != null);
            Debug.Assert(type.IsAnonymousType);

            var anonymous = (AnonymousTypePublicSymbol)type;