Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected value 'UnconvertedInterpolatedString' in CSharpOperationFactory #76444

Open
Cosifne opened this issue Dec 16, 2024 · 0 comments
Open
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@Cosifne
Copy link
Member

Cosifne commented Dec 16, 2024

Version Used: Version 17.13.0 Preview 3.0 [35615.4.main]

Many golden bars shows up when I typing in this file:
Image

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CodeAnalysis.Options;

namespace Roslyn.VisualStudio.Next.UnitTests.UnifiedSettings.TestModel
{
    internal class ExpectedSetting(string path, IOption2 option, UnifiedSettingBase setting)
    {
        public string ExpectedUnifiedSettingsPath => path;
        public IOption2 Option => option;
        public UnifiedSettingBase ExpectedUnifiedSetting => setting;

        public static ExpectedSetting Create<T>(
            string ExpectedUnifiedSettingsPath,
            IOption2 roslynOption,
            string title,
            int order,
            T defaultValue,
            (IOption2 featureFlagOption, object value) featureFlagAndExperimentValue = default,
            (IOption2 enableWhenOption, object whenValue) enableWhenOptionAndValue = default,
            string? languageName = null)
        {
            var migration = new Migration
            {
                Pass = new Pass()
                {
                    Input = Input(roslynOption, languageName)
                }
            };

            var alternativeDefault = featureFlagAndExperimentValue is not default
                ? new AlternativeDefault<T>(featureFlagAndExperimentValue.featureFlagOption, featureFlagAndExperimentValue.value)
                : null;

            var enableWhen = enableWhenOptionAndValue is not default
                ? $"config:{enableWhenOptionAndValue.}"='{en}'"

        }
    }
}

The stack trace is:

StreamJsonRpc.RemoteInvocationException: Unexpected value 'UnconvertedInterpolatedString' of type 'Microsoft.CodeAnalysis.CSharp.BoundKind'
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__156`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<TryInvokeAsync>d__20`1.MoveNext()
RPC server exception:
System.InvalidOperationException: Unexpected value 'UnconvertedInterpolatedString' of type 'Microsoft.CodeAnalysis.CSharp.BoundKind'
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundAssignmentOperatorOperation(BoundAssignmentOperator boundAssignmentOperator)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundAssignmentOperatorOrMemberInitializerOperation(BoundAssignmentOperator boundAssignmentOperator)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundConditionalOperatorOperation(BoundConditionalOperator boundConditionalOperator)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateVariableDeclaratorInitializer(BoundLocalDeclaration boundLocalDeclaration, SyntaxNode syntax)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateVariableDeclaratorInternal(BoundLocalDeclaration boundLocalDeclaration, SyntaxNode syntax)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateVariableDeclarator(BoundNode declaration, SyntaxNode declarationSyntax)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundLocalDeclarationOperation(BoundLocalDeclaration boundLocalDeclaration)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateFromArray[TBoundNode,TOperation](ImmutableArray`1 boundNodes)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateBoundBlockOperation(BoundBlock boundBlock)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.CreateMethodBodyOperation(BoundNonConstructorMethodBody boundNode)
      at Microsoft.CodeAnalysis.Operations.CSharpOperationFactory.Create(BoundNode boundNode)
      at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetRootOperation()
      at Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetOperationWorker(CSharpSyntaxNode node, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.FindSymbols.Finders.AbstractReferenceFinder.<GetSymbolUsageInfo>g__GetSymbolUsageInfoCommon|39_1(<>c__DisplayClass39_0&)
      at Microsoft.CodeAnalysis.FindSymbols.Finders.AbstractReferenceFinder.GetSymbolUsageInfo(SyntaxNode node, FindReferencesDocumentState state, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.FindSymbols.Finders.AbstractReferenceFinder.CreateReferenceLocation(FindReferencesDocumentState state, SyntaxToken token, CandidateReason reason, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.FindSymbols.Finders.AbstractReferenceFinder.FindReferencesInTokens[TData](ISymbol symbol, FindReferencesDocumentState state, ImmutableArray`1 tokens, Action`2 processResult, TData processResultData, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<>c.<FindReferencesInDocumentsAsync>b__28_11(Action`1 callback, ValueTuple`4 args, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Shared.Utilities.ProducerConsumer`1.<>c__DisplayClass12_0`2.<<RunChannelAsync>g__ProduceItemsAndWriteToChannelAsync|2>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Shared.Utilities.ProducerConsumer`1.RunChannelAsync[TArgs,TResult](ProducerConsumerOptions options, Func`4 produceItems, Func`4 consumeItems, TArgs args, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<>c__DisplayClass28_0.<<FindReferencesInDocumentsAsync>g__DirectSymbolSearchAsync|5>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<>c__DisplayClass28_0.<<FindReferencesInDocumentsAsync>g__PerformSearchInDocumentSeriallyWorkerAsync|4>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<>c__DisplayClass28_0.<<FindReferencesInDocumentsAsync>g__PerformSearchInDocumentSeriallyAsync|3>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<>c__DisplayClass28_0.<<FindReferencesInDocumentsAsync>g__PerformSearchInProjectSeriallyAsync|2>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.FindReferencesInDocumentsAsync(ISymbol originalSymbol, IImmutableSet`1 documents, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.DocumentHighlighting.AbstractDocumentHighlightsService.GetTagsForReferencedSymbolAsync(ISymbol symbol, Document document, IImmutableSet`1 documentsToSearch, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.DocumentHighlighting.AbstractDocumentHighlightsService.GetDocumentHighlightsInCurrentProcessAsync(Document document, Int32 position, IImmutableSet`1 documentsToSearch, HighlightingOptions options, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.DocumentHighlighting.AbstractDocumentHighlightsService.GetDocumentHighlightsAsync(Document document, Int32 position, IImmutableSet`1 documentsToSearch, HighlightingOptions options, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteDocumentHighlightsService.<>c__DisplayClass2_0.<<GetDocumentHighlightsAsync>b__0>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_0`1.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsync[T](Checksum solutionChecksum, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunServiceImplAsync[T](Func`2 implementation, CancellationToken cancellationToken)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants