1 write to Symbol
Microsoft.CodeAnalysis (1)
Compilation\SymbolInfo.cs (1)
65this.Symbol = symbol;
3271 references to Symbol
Microsoft.CodeAnalysis (8)
Compilation\SymbolInfo.cs (7)
18/// Array of potential candidate symbols if <see cref="Symbol"/> did not bind successfully. Note: all code in 81=> this.Symbol == null ? CandidateSymbols : ImmutableArray.Create(this.Symbol); 88object.Equals(this.Symbol, other.Symbol) && 92=> Hash.Combine(this.Symbol, Hash.Combine(Hash.CombineValues(this.CandidateSymbols, 4), (int)this.CandidateReason)); 94internal bool IsEmpty => this.Symbol == null && this.CandidateSymbols.Length == 0;
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
112syntaxHelper.IsLambdaExpression(targetNode) ? semanticModel.GetSymbolInfo(targetNode, cancellationToken).Symbol :
Microsoft.CodeAnalysis.CodeStyle (32)
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
547var symbol = lazyModel.GetSymbolInfo(node, cancellationToken).Symbol?.OriginalDefinition;
AbstractSpeculationAnalyzer.cs (13)
297if (SymbolsAreCompatibleCore(originalSymbolInfo.Symbol, newSymbolInfo.Symbol, performEquivalenceCheck, requireNonNullSymbols)) 626var originalIsStaticAccess = IsStaticAccess(_semanticModel.GetSymbolInfo(originalExpression, CancellationToken).Symbol); 627var replacedIsStaticAccess = IsStaticAccess(this.SpeculativeSemanticModel.GetSymbolInfo(newExpression, CancellationToken).Symbol); 683var originalExpressionSymbol = this.OriginalSemanticModel.GetSymbolInfo(currentOriginalNode).Symbol; 684var replacedExpressionSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(currentReplacedNode).Symbol; 714var attributeSym = this.OriginalSemanticModel.GetSymbolInfo(attribute).Symbol; 715var newAttributeSym = this.SpeculativeSemanticModel.GetSymbolInfo(newAttribute).Symbol; 818var symbol = this.OriginalSemanticModel.GetSymbolInfo(type).Symbol; 823newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newType, _cancellationToken).Symbol; 828newSymbol = this.OriginalSemanticModel.GetSpeculativeSymbolInfo(type.SpanStart, newType, bindingOption).Symbol; 858var symbol = originalSymbolInfo.Symbol; 859var newSymbol = newSymbolInfo.Symbol;
AbstractUseAutoPropertyAnalyzer.cs (1)
281return symbolInfo.Symbol is IFieldSymbol { DeclaringSyntaxReferences.Length: 1 } field
AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
101var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
303var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
AbstractValidateFormatStringDiagnosticAnalyzer.cs (5)
282if (symbolInfo.Symbol == null) 287if (symbolInfo.Symbol.Kind != SymbolKind.Method) 292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction) 297var containingType = symbolInfo.Symbol.ContainingType; 308return (IMethodSymbol)symbolInfo.Symbol;
ISemanticFactsExtensions.cs (1)
95if (IsUserDefinedOperator(symbolInfo.Symbol))
SymbolInfoExtensions.cs (5)
19if (info.Symbol == null) 26builder.Add(info.Symbol); 33=> info.Symbol ?? info.CandidateSymbols.FirstOrDefault(); 37if (info.Symbol != null) 39return ImmutableArray.Create(info.Symbol);
SymbolKey.SymbolKeyReader.cs (2)
751if (info.Symbol != null) 752return new SymbolKeyResolution(info.Symbol);
UseCompoundAssignmentUtilities.cs (2)
104symbolInfo.Symbol == null) 110var symbol = symbolInfo.Symbol;
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
105=> semanticModel.GetSymbolInfo(node, cancellationToken).Symbol as IMethodSymbol ??
AbstractUnsealClassCodeFixProvider.cs (1)
39if (semanticModel.GetSymbolInfo(node, cancellationToken).Symbol is INamedTypeSymbol type &&
Fixer.cs (3)
51if (symbolInfo.Symbol != null) // BC42016: the only candidate symbol is symbolInfo.Symbol 53candidateSymbols.Add(symbolInfo.Symbol); 214return symbolInfo.Symbol != null;
SimplificationHelpers.cs (5)
88if (!IsValidSymbolInfo(symbolInfo.Symbol)) 91return symbolInfo.Symbol; 103if (IsValidSymbolInfo(expressionInfo.Symbol)) 105if (expressionInfo.Symbol is INamespaceOrTypeSymbol) 108if (expressionInfo.Symbol.IsThisParameter())
Microsoft.CodeAnalysis.CSharp (11)
Compilation\CSharpSemanticModel.cs (5)
1176return info.Symbol as IAliasSymbol; 1211return symbolInfo.Symbol as IAliasSymbol; 4487if ((object)containingInvocationInfo.Symbol != null) 4489ParameterSymbol param = FindNamedParameter(containingInvocationInfo.Symbol.GetSymbol().GetParameters(), argumentName); 5133return (GetSymbolInfo(tupleTypeSyntax, cancellationToken).Symbol.GetSymbol() as NamedTypeSymbol)?.TupleElements.ElementAtOrDefault(tupleTypeSyntax.Elements.IndexOf(declarationSyntax)).GetPublicSymbol();
Compilation\MemberSemanticModel.cs (2)
865if ((object)symbolInfo.Symbol != null) 867lambdaSymbol = symbolInfo.Symbol.GetSymbol<LambdaSymbol>();
Compilation\PublicSemanticModel.cs (1)
45AnonymousFunctionExpressionSyntax anonymousFunction => GetSymbolInfo(anonymousFunction).Symbol.GetSymbol(),
Compilation\SyntaxTreeSemanticModel.cs (3)
219if ((object)result.Symbol == null && result.CandidateReason == CandidateReason.None && node is ExpressionSyntax && SyntaxFacts.IsInNamespaceOrTypeContext((ExpressionSyntax)node)) 232if ((object)info.Symbol != null) 234result = new SymbolInfo(ImmutableArray.Create<ISymbol>(info.Symbol), CandidateReason.NotATypeOrNamespace);
Microsoft.CodeAnalysis.CSharp.CodeStyle (44)
CastSimplifier.cs (8)
991if (oldSymbolInfo.Symbol != null) 996if (newSymbolInfo.Symbol is null) 1022var oldSymbolInfo = originalSemanticModel.GetSymbolInfo(currentOld, cancellationToken).Symbol; 1023var newSymbolInfo = rewrittenSemanticModel.GetSymbolInfo(currentNew, cancellationToken).Symbol; 1075var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1080var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1184var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1189var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol;
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
89var symbol = semanticModel.GetSymbolInfo(_assignmentTargetOpt).Symbol;
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
336_localSymbol.Equals(_semanticModel.GetSymbolInfo(identifierName, _cancellationToken).Symbol))
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (5)
165var asOperand = semanticModel.GetSymbolInfo(asExpression.Left, cancellationToken).Symbol; 182asOperand.Equals(semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol) && 219localSymbol.Equals(semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol)) 239localSymbol.Equals(semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol)) 321localSymbol = semanticModel.GetSymbolInfo(identifier).Symbol as ILocalSymbol;
CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
125if (semanticModel.GetSymbolInfo(argumentExpression, cancellationToken).Symbol is not ILocalSymbol outLocalSymbol) 358var symbol = semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol;
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (5)
131if (lambdaSymbolInfo.Symbol is not IMethodSymbol lambdaMethod) 135if (invokedSymbolInfo.Symbol is not IMethodSymbol invokedMethod) 188if (rewrittenSymbolInfo.Symbol is not IMethodSymbol rewrittenMethod || 229var method1 = semanticModel1.GetSymbolInfo(node1, cancellationToken).Symbol as IMethodSymbol; 230var method2 = semanticModel2.GetSymbolInfo(node2, cancellationToken).Symbol as IMethodSymbol;
CSharpSemanticFacts.cs (2)
325var hasCastInfo = queryInfo.CastInfo.Symbol != null; 326var hasOperationInfo = queryInfo.OperationInfo.Symbol != null;
CSharpUseAutoPropertyAnalyzer.cs (1)
125AddIneligibleField(symbolInfo.Symbol);
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
196var symbol = semanticModel.GetSymbolInfo(binaryExpression, cancellationToken).Symbol; 213var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
CSharpUseImplicitTypeHelper.cs (2)
100var conflict = semanticModel.GetSpeculativeSymbolInfo(typeName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol; 305if (semanticModel.GetSymbolInfo(n, cancellationToken).Symbol.IsKind(SymbolKind.Local) == true)
ExpressionSyntaxExtensions.cs (1)
369var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol;
NullableImpactingSpanWalker.cs (2)
152if (symbolInfo.Symbol.IsKind(SymbolKind.Namespace)) 157else if (symbolInfo.Symbol is INamedTypeSymbol { IsValueType: true, IsGenericType: false })
ParenthesizedExpressionSyntaxExtensions.cs (1)
311var exprSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
SemanticModelExtensions.cs (6)
119else if (symbolInfo.Symbol != null) 121symbol = symbolInfo.Symbol as INamespaceOrTypeSymbol; 172if (symbolInfo.Symbol != null && symbolInfo.Symbol.Kind == SymbolKind.Namespace) 175result.Add((INamespaceSymbol)symbolInfo.Symbol); 437if (semanticModel.GetSymbolInfo(argumentList.Parent, cancellationToken).Symbol is IMethodSymbol member && index < member.Parameters.Length)
SpeculationAnalyzer.cs (4)
555var originalSymbol = this.OriginalSemanticModel.GetSymbolInfo(ctorInitializer, CancellationToken).Symbol; 556var newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newCtorInitializer, CancellationToken).Symbol; 562var originalSymbol = this.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol; 563var newSymbol = this.SpeculativeSemanticModel.GetCollectionInitializerSymbolInfo(newInitializer, CancellationToken).Symbol;
TypeStyleHelper.cs (1)
104if (semanticModel.GetSymbolInfo(memberName, cancellationToken).Symbol is not IMethodSymbol methodSymbol)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
262var expressionType = _semanticModel.GetSymbolInfo(node.Expression).Symbol.GetSymbolType();
CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
75if (semanticModel.GetSymbolInfo(invocationExpression, cancellationToken).Symbol is not IMethodSymbol methodSymbol)
CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
34var typeSymbol = model.GetSymbolInfo(typeOfExpression.Type, cancellationToken).Symbol.GetSymbolType();
CSharpDeclareAsNullableCodeFixProvider.cs (3)
79var symbol = model.GetSymbolInfo(assignment.Left).Symbol; 192var symbol = model.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 234var symbol = model.GetSymbolInfo(invocation.Expression, cancellationToken).Symbol;
CSharpInlineDeclarationCodeFixProvider.cs (2)
348var previousSymbol = semanticModel.GetSymbolInfo(nodeToReplace, cancellationToken).Symbol; 376if (!SymbolEquivalenceComparer.Instance.Equals(previousSymbol, updatedSymbolInfo.Symbol))
CSharpTypeInferenceService.TypeInferrer.cs (3)
475if (info.Symbol == null || 476argumentOpt == null && info.Symbol is IMethodSymbol method && method.Parameters.All(p => p.IsOptional || p.IsParams)) 1863SemanticModel.GetSymbolInfo(identifierName.Identifier).Symbol?.Kind == SymbolKind.Parameter)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
2509if (semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol is ITypeSymbol type && !type.CanSupportCollectionInitializer(containingSymbol)) 2799return semanticModelOpt.GetSymbolInfo(parentExpression, cancellationToken).Symbol == null;
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
263var symbol = symbolInfo.Symbol;
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
225var symbol = semanticModel.GetSymbolInfo(parentToken.Left, cancellationToken).Symbol;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
51var symbol = context.SemanticModel.GetSymbolInfo(node).Symbol;
SymbolKey\SymbolKeyTestBase.cs (2)
63ResolveAndVerifySymbol(syminfo.Symbol, sourceSymbol, sourceComp, comparison); 406list.Add(sinfo.Symbol);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (165)
CodeGen\CodeGenCheckedTests.cs (3)
2920model.GetSpeculativeSymbolInfo(xNode.Position, nodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString()); 2926model.GetSpeculativeSymbolInfo(checkedNode.Position + 2, nodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString()); 2952model.GetSpeculativeSymbolInfo(xNode.Position, nodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString());
CodeGen\CodeGenDeconstructTests.cs (96)
3133Assert.Null(model.GetSymbolInfo(lhs).Symbol); 3138Assert.Null(model.GetSymbolInfo(lhsNested).Symbol); 3182Assert.Null(model.GetSymbolInfo(lhs).Symbol); 3187Assert.Null(model.GetSymbolInfo(x234).Symbol); 3192Assert.Null(model.GetSymbolInfo(x34).Symbol); 3246Assert.Null(model.GetSymbolInfo(x123).Symbol); 3251Assert.Null(model.GetSymbolInfo(x23).Symbol); 3284Assert.Null(model.GetSymbolInfo(lhs).Symbol); 3290Assert.Null(model.GetSymbolInfo(lhsNested).Symbol); 3334Assert.Null(model.GetSymbolInfo(lhs).Symbol); 3339Assert.Null(model.GetSymbolInfo(lhsNested).Symbol); 3590Assert.Null(model.GetSymbolInfo(typeSyntax).Symbol); 3596Assert.Equal(local.Type.GetPublicSymbol(), model.GetSymbolInfo(typeSyntax).Symbol); 3602Assert.Same(symbol, model.GetSymbolInfo(reference).Symbol); 3621Assert.Same(field, model.GetSymbolInfo(reference).Symbol); 3700Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3701Assert.Equal("var", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString()); 3705Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x2Type).Symbol.Kind); 3706Assert.Equal("int", model.GetSymbolInfo(x2Type).Symbol.ToDisplayString()); 3753Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3754Assert.Equal("int", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString()); 3759Assert.Equal("(System.Int32 x3, System.Int32 x4)", model.GetSymbolInfo(x34Var.Type).Symbol.ToTestDisplayString()); 3802Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3803Assert.Equal("D", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString()); 3810Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x2Type).Symbol.Kind); 3811Assert.Equal("int", model.GetSymbolInfo(x2Type).Symbol.ToDisplayString()); 3853Assert.Equal("(System.Int32 x1, System.Int32 x2)", model.GetSymbolInfo(x12Var.Type).Symbol.ToTestDisplayString()); 3942Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3943Assert.Equal("int", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString()); 3947Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x2Type).Symbol.Kind); 3948Assert.Equal("var", model.GetSymbolInfo(x2Type).Symbol.ToDisplayString()); 3988Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 3989Assert.Equal("int", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString()); 3993Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x2Type).Symbol.Kind); 3994Assert.Equal("int", model.GetSymbolInfo(x2Type).Symbol.ToDisplayString()); 4039Assert.Equal("(System.Int32 x1, System.Int32 x2)", model.GetSymbolInfo(x12Var.Type).Symbol.ToTestDisplayString()); 4146Assert.Equal("(System.Int32 x1, System.Int32 x2)", model.GetSymbolInfo(x12Var.Type).Symbol.ToTestDisplayString()); 4229Assert.Equal("(System.Int32 x1, System.Int32 x2)", model.GetSymbolInfo(x12Var.Type).Symbol.ToTestDisplayString()); 4340Assert.Equal("(System.Int32 x1, System.Int32 x2)", model.GetSymbolInfo(x12Var.Type).Symbol.ToTestDisplayString()); 4407var symbol = model.GetSymbolInfo(collection).Symbol; 4461Assert.Equal("(System.Int32 x2, System.Int32 x3)", model.GetSymbolInfo(x23Var.Type).Symbol.ToTestDisplayString()); 4607Assert.Equal("(System.Int32 x2, System.Int32 x3)", model.GetSymbolInfo(x23Var.Type).Symbol.ToTestDisplayString()); 5035Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(xType).Symbol.Kind); 5036Assert.Equal("string", model.GetSymbolInfo(xType).Symbol.ToDisplayString()); 5041Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(yType).Symbol.Kind); 5042Assert.Equal("int", model.GetSymbolInfo(yType).Symbol.ToDisplayString()); 5187Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 5188Assert.Equal("string", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString()); 5194Assert.Equal("(System.Int32 x2, System.Int32 x3)", model.GetSymbolInfo(x23Var.Type).Symbol.ToTestDisplayString()); 5742Assert.Equal("System.Byte", model.GetSymbolInfo(x123Var.Type).Symbol.ToTestDisplayString()); 5784Assert.Equal("Script.var", model.GetSymbolInfo(x123Var.Type).Symbol.ToTestDisplayString()); 5818Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 5819Assert.Equal("byte", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString()); 5826Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x3Type).Symbol.Kind); 5827Assert.Equal("byte", model.GetSymbolInfo(x3Type).Symbol.ToDisplayString()); 5858Assert.Null(model.GetSymbolInfo(x1).Symbol); 5865Assert.Null(model.GetSymbolInfo(x3).Symbol); 5870Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x1Type).Symbol.Kind); 5871Assert.Equal("var", model.GetSymbolInfo(x1Type).Symbol.ToDisplayString()); 5876Assert.Equal(SymbolKind.NamedType, model.GetSymbolInfo(x3Type).Symbol.Kind); 5877Assert.Equal("var", model.GetSymbolInfo(x3Type).Symbol.ToDisplayString()); 5910Assert.Null(model.GetSymbolInfo(discard1).Symbol); 5914Assert.Null(model.GetSymbolInfo(declaration1).Symbol); 5918Assert.Null(model.GetSymbolInfo(discard2).Symbol); 5922Assert.Null(model.GetSymbolInfo(declaration2).Symbol); 5928Assert.Null(model.GetSymbolInfo(declaration3).Symbol); 6000var symbol = (IDiscardSymbol)model.GetSymbolInfo(discard).Symbol; 6033var symbol0 = (IDiscardSymbol)model.GetSymbolInfo(discards[0]).Symbol; 6038var symbol = (IDiscardSymbol)model.GetSymbolInfo(discard).Symbol; 6086var symbol0 = (IDiscardSymbol)model.GetSymbolInfo(discards[0]).Symbol; 6091var symbol = (IDiscardSymbol)model.GetSymbolInfo(discard).Symbol; 6135var symbol0 = (IDiscardSymbol)model.GetSymbolInfo(discards[0]).Symbol; 6139var symbol = (IDiscardSymbol)model.GetSymbolInfo(discard).Symbol; 6256var symbol = (ILocalSymbol)model.GetSymbolInfo(discard).Symbol; 6307Assert.Equal("long _", model.GetSymbolInfo(discard1).Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat)); 6312Assert.Null(model.GetSymbolInfo(tuple1).Symbol); 6369var symbol = (ILocalSymbol)model.GetSymbolInfo(discard).Symbol; 6405Assert.Equal("int _", model.GetSymbolInfo(discard2).Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat)); 6411Assert.Null(model.GetSymbolInfo(yz).Symbol); 6416Assert.Equal("System.String y", model.GetSymbolInfo(y).Symbol.ToTestDisplayString()); 6938Assert.Null(model.GetSymbolInfo(nestedDeclaration).Symbol); 6943Assert.Null(model.GetSymbolInfo(tuple).Symbol); 6982Assert.Null(model.GetSymbolInfo(declaration1).Symbol); 6991Assert.Null(model.GetSymbolInfo(declaration2).Symbol); 6997Assert.Equal("int _", model.GetSymbolInfo(discard3).Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat)); 6998var discard3Symbol = (IDiscardSymbol)model.GetSymbolInfo(discard3).Symbol; 7010Assert.Null(model.GetSymbolInfo(nestedDeclaration).Symbol); 7069var symbol = (DiscardSymbol)model.GetSymbolInfo(discard).Symbol.GetSymbol(); 7235Assert.Equal(symbolInfo.Symbol, model.GetDeclaredSymbol(x1)); 7236Assert.Equal(SpecialType.System_Int32, symbolInfo.Symbol.GetTypeOrReturnType().SpecialType); 7310Assert.Null(symbolInfo.Symbol); 7317Assert.Null(symbolInfo.Symbol); 7510Assert.Equal(xSymbolInfo.Symbol, model.GetDeclaredSymbol(x)); 7511Assert.Equal(SpecialType.System_Int32, xSymbolInfo.Symbol.GetTypeOrReturnType().SpecialType); 7517Assert.Equal(zSymbolInfo.Symbol, model.GetDeclaredSymbol(z)); 7518Assert.Equal(SpecialType.System_Boolean, zSymbolInfo.Symbol.GetTypeOrReturnType().SpecialType);
CodeGen\CodeGenFunctionPointersTests.cs (1)
7407var lambdaSymbol = (IMethodSymbol)info.Symbol!;
CodeGen\CodeGenRefLocalTests.cs (6)
3263Assert.Equal("System.Int32", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 3266Assert.Null(model.GetSymbolInfo(refVar).Symbol); 3300Assert.Equal("C", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 3305Assert.Null(model.GetSymbolInfo(refVar).Symbol); 3334Assert.Equal("System.Int32", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 3337Assert.Null(model.GetSymbolInfo(refInt).Symbol);
CodeGen\CodeGenTupleEqualityTests.cs (11)
365Assert.Null(model.GetSymbolInfo(tupleX).Symbol); 370Assert.Equal("System.Int32 x", model.GetSymbolInfo(lastX).Symbol.ToTestDisplayString()); 739Assert.Equal("(System.Int32, System.Byte) t", model.GetSymbolInfo(t).Symbol.ToTestDisplayString()); 749Assert.Null(model.GetSymbolInfo(tuple).Symbol); 982Assert.Equal("(System.Int32, (System.Int64, System.String)) t1", model.GetSymbolInfo(t1).Symbol.ToTestDisplayString()); 998Assert.Equal("(System.Int32, System.String) t2", model.GetSymbolInfo(t2).Symbol.ToTestDisplayString()); 1534Assert.Equal("(System.String, System.String) t", model.GetSymbolInfo(t).Symbol.ToTestDisplayString()); 1545Assert.Null(model.GetSymbolInfo(nestedTuple).Symbol); 1720Assert.Null(model.GetSymbolInfo(methodGroup).Symbol); 1732Assert.Equal("System.Int32 i", model.GetSymbolInfo(i).Symbol.ToTestDisplayString()); 1735Assert.Equal("System.Int32 j", model.GetSymbolInfo(j).Symbol.ToTestDisplayString());
CodeGen\CodeGenTupleTest.cs (44)
4837model.GetSymbolInfo(invocation1.Expression).Symbol.ToTestDisplayString()); 4842model.GetSymbolInfo(invocation2.Expression).Symbol.ToTestDisplayString()); 5073model.GetSymbolInfo(invocation.Expression).Symbol.ToTestDisplayString()); 5117model.GetSymbolInfo(invocation.Expression).Symbol.ToTestDisplayString()); 5157Assert.Equal("(System.Int32, System.Int32) D.P { get; set; }", model.GetSymbolInfo(memberAccess).Symbol.ToTestDisplayString()); 5161Assert.Equal("(System.Int32, System.Int32) D.P { get; set; }", model.GetSymbolInfo(memberAccess2).Symbol.ToTestDisplayString()); 5165Assert.Equal("(System.Int32 a, System.Int32 b) C.P { get; set; }", model.GetSymbolInfo(memberAccess3).Symbol.ToTestDisplayString()); 5202model.GetSymbolInfo(invocation.Expression).Symbol.ToTestDisplayString()); 13983Assert.True(((ITypeSymbol)nameofArgSymbolInfo.Symbol).IsTupleType); 13985nameofArgSymbolInfo.Symbol.ToTestDisplayString()); 13994Assert.Equal(typeInfo.Type, symbolInfo.Symbol); 14253m1Tuple = (INamedTypeSymbol)((IMethodSymbol)symbolInfo.Symbol).ReturnType; 14260m1Tuple = (INamedTypeSymbol)((IMethodSymbol)symbolInfo.Symbol).Parameters[0].Type; 14269var m2Tuple = (INamedTypeSymbol)((IMethodSymbol)symbolInfo.Symbol).ReturnType; 14283f1Tuple = (INamedTypeSymbol)((IFieldSymbol)symbolInfo.Symbol).Type; 14297p1Tuple = (INamedTypeSymbol)((IPropertySymbol)symbolInfo.Symbol).Type; 14314m3TupleArray = (IArrayTypeSymbol)((IMethodSymbol)symbolInfo.Symbol).ReturnType; 14332m4TupleList = (INamedTypeSymbol)((IMethodSymbol)symbolInfo.Symbol).ReturnType; 14339var m5Tuple = ((IMethodSymbol)symbolInfo.Symbol).TypeParameters[0].ConstraintTypes.Single(); 14346var m6Method = (IMethodSymbol)symbolInfo.Symbol; 14455m5TuplePointer = (IPointerTypeSymbol)((IMethodSymbol)symbolInfo.Symbol).ReturnType; 14462var v1Type = ((ILocalSymbol)symbolInfo.Symbol).Type; 14472var v2Type = ((ILocalSymbol)symbolInfo.Symbol).Type; 17380Assert.Equal(SymbolKind.Field, sym.Symbol.Kind); 17381Assert.Equal("Alice", sym.Symbol.Name); 17382Assert.Equal(nc.Name.GetLocation(), sym.Symbol.Locations[0]); 17411var x1Symbol = model.GetSymbolInfo(x1Bob.Expression).Symbol as ILocalSymbol; 19668Assert.Equal("(System.Int32 a, System.Int32)", ((IMethodSymbol)invocation1.Symbol).ReturnType.ToTestDisplayString()); 19671Assert.Equal("(System.Int32, System.Int32)", ((IMethodSymbol)invocation2.Symbol).ReturnType.ToTestDisplayString()); 19674Assert.Equal("(System.Int32, System.Int32)[]", ((IMethodSymbol)invocation3.Symbol).ReturnType.ToTestDisplayString()); 19712Assert.Equal("(System.Int32 a, System.Int32 b) C.M2<(System.Int32 a, System.Int32 b)>((System.Int32 a, System.Int32 b) x1, (System.Int32 a, System.Int32 b) x2)", invocation1.Symbol.ToTestDisplayString()); 19715Assert.Equal("(System.Int64, System.Int32 b) C.M2<(System.Int64, System.Int32 b)>((System.Int64, System.Int32 b) x1, (System.Int64, System.Int32 b) x2)", invocation2.Symbol.ToTestDisplayString()); 19718Assert.Equal("(System.Int64 a, System.Int32 b) C.M2<(System.Int64 a, System.Int32 b)>((System.Int64 a, System.Int32 b) x1, (System.Int64 a, System.Int32 b) x2)", invocation3.Symbol.ToTestDisplayString()); 19743Assert.Equal("void C.M2<(dynamic[] a, dynamic[])>((dynamic[] a, dynamic[]) x1, (dynamic[] a, dynamic[]) x2)", invocation1.Symbol.ToTestDisplayString()); 24223Assert.Equal("System.Int32 (System.Int32 elem1, System.Int32 elem2).elem2", model.GetSymbolInfo(nodes[0]).Symbol.ToTestDisplayString()); 24226Assert.Equal("System.Int32 elem2", model.GetSymbolInfo(nodes[1]).Symbol.ToTestDisplayString()); 24229Assert.Equal("System.Int32 (System.Int32 elem1, System.Int32 elem2).elem2", model.GetSymbolInfo(nodes[2]).Symbol.ToTestDisplayString()); 24232Assert.Equal("System.Int32 elem2", model.GetSymbolInfo(nodes[3]).Symbol.ToTestDisplayString()); 24237Assert.Equal("(System.Int32 elem1, System.Int32 elem2)", symbolInfo.Symbol.ToTestDisplayString()); 24242Assert.Equal(symbolInfo.Symbol, typeInfo.Type); 26335var doSymbol = (IMethodSymbol)model.GetSymbolInfo(doSyntax).Symbol; 26368var doSymbol = (IMethodSymbol)model.GetSymbolInfo(doSyntax).Symbol; 26401var doSymbol = (IMethodSymbol)model.GetSymbolInfo(doSyntax).Symbol; 26434var doSymbol = (IMethodSymbol)model.GetSymbolInfo(doSyntax).Symbol;
CodeGen\IndexAndRangeTests.cs (4)
883var substringCall = (IMethodSymbol)info.Symbol; 885var sliceCall = (IMethodSymbol)info.Symbol; 921VerifyIndexCall((IMethodSymbol)model.GetSymbolInfo(accesses[0]).Symbol, "Slice", "Span"); 998var property = (IPropertySymbol)info.Symbol;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (94)
Attributes\AttributeTests.cs (3)
5425var args = info.Symbol.GetAttributes()[0].CommonConstructorArguments; 7247Assert.Null(info.Symbol); 7288Assert.Null(info.Symbol);
Attributes\AttributeTests_RefReadOnly.cs (2)
1384Assert.NotNull(result.Symbol); 1426Assert.NotNull(result.Symbol);
Attributes\AttributeTests_WellKnownAttributes.cs (3)
11262var lambda = exprs.SelectAsArray(e => model.GetSymbolInfo(e).Symbol).Single().GetSymbol<LambdaSymbol>(); 11287var lambda = exprs.SelectAsArray(e => model.GetSymbolInfo(e).Symbol).Single().GetSymbol<LambdaSymbol>(); 11318var lambda = exprs.SelectAsArray(e => model.GetSymbolInfo(e).Symbol).Single().GetSymbol<LambdaSymbol>();
Emit\NumericIntPtrTests.cs (11)
1884var actualOperators = nodes.Select(n => model.GetSymbolInfo(n).Symbol.ToTestDisplayString()).ToArray(); 1936var actualOperators = nodes.Select(n => model.GetSymbolInfo(n).Symbol.ToTestDisplayString()).ToArray(); 6213Assert.Equal(expectedSymbol, symbolInfo.Symbol?.ToDisplayString(SymbolDisplayFormat.TestFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes))); 6589Assert.Equal(expectedSymbol, symbolInfo.Symbol?.ToDisplayString(SymbolDisplayFormat.TestFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes))); 6821Assert.Equal(expectedSymbol, symbolInfo.Symbol?.ToDisplayString(SymbolDisplayFormat.TestFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes))); 8094Assert.Equal(expectedSymbol, symbolInfo.Symbol?.ToDisplayString(SymbolDisplayFormat.TestFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes))); 11143var nintSymbol = (INamedTypeSymbol)model.GetSymbolInfo(cref).Symbol; 11166var symbol = (INamedTypeSymbol)model.GetSymbolInfo(cref).Symbol; 11194var symbol = (IFieldSymbol)model.GetSymbolInfo(cref).Symbol; 11219var symbol = (IFieldSymbol)model.GetSymbolInfo(cref).Symbol; 11264var symbol = (IFieldSymbol)model.GetSymbolInfo(cref).Symbol;
Semantics\PatternMatchingTestBase.cs (17)
111Assert.Null(model.GetSymbolInfo(typeSyntax).Symbol); 115Assert.Equal(type, model.GetSymbolInfo(typeSyntax).Symbol); 125Assert.Same(symbol, model.GetSymbolInfo(reference).Symbol); 156Assert.Equal(type, model.GetSymbolInfo(decl.Type).Symbol); 193var symbol = model.GetSymbolInfo(reference).Symbol; 203var symbol = model.GetSymbolInfo(reference).Symbol; 217Assert.Null(model.GetSymbolInfo(reference).Symbol); 277Assert.Null(model.GetSymbolInfo(typeSyntax).Symbol); 281Assert.Equal(type, model.GetSymbolInfo(typeSyntax).Symbol); 296Assert.Null(model.GetSymbolInfo(designation).Symbol); 297Assert.Null(model.GetSymbolInfo(designation).Symbol); 306Assert.Null(referenceInfo.Symbol); 313Assert.Same(symbol, referenceInfo.Symbol); 371Assert.Null(model.GetSymbolInfo(designation).Symbol); 379Assert.Null(model.GetSymbolInfo(decl.Type).Symbol); 410Assert.Null(model.GetSymbolInfo(reference).Symbol); 441Assert.Null(info.Symbol);
Semantics\PatternMatchingTests.cs (4)
3268Assert.Null(symbolInfo.Symbol); 4300Assert.Null(model.GetSymbolInfo(discard2).Symbol); 4303Assert.Null(model.GetSymbolInfo(declaration2).Symbol); 4796Assert.Null(model.GetSymbolInfo(colorRef[0]).Symbol);
Semantics\PatternMatchingTests3.cs (36)
57Assert.Equal("System.Int32 Point.X", xSymbol.Symbol.ToTestDisplayString()); 65Assert.Equal("System.Int32 Point.Y { get; }", ySymbol.Symbol.ToTestDisplayString()); 117Assert.Null(xSymbol.Symbol); 127Assert.Null(ySymbol.Symbol); 168Assert.Null(xSymbol.Symbol); 176Assert.Null(ySymbol.Symbol); 213Assert.Equal("out System.Int32 X", xSymbol.Symbol.ToTestDisplayString()); 221Assert.Equal("out System.Int32 Y", ySymbol.Symbol.ToTestDisplayString()); 266Assert.Equal("out System.Int32 Z", xSymbol.Symbol.ToTestDisplayString()); 274Assert.Equal("out System.Int32 W", ySymbol.Symbol.ToTestDisplayString()); 307Assert.Equal("System.Int32 (System.Int32 X, System.Int32 Y).X", xSymbol.Symbol.ToTestDisplayString()); 315Assert.Equal("System.Int32 (System.Int32 X, System.Int32 Y).Y", ySymbol.Symbol.ToTestDisplayString()); 354Assert.Null(xSymbol.Symbol); 362Assert.Null(ySymbol.Symbol); 4131Assert.Equal("System.Int32 N", model.GetSymbolInfo(((ConstantPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4160Assert.Equal("System.Int64", model.GetSymbolInfo(((TypePatternSyntax)pattern).Type).Symbol.ToTestDisplayString()); 4175Assert.Equal("System.Int32", model.GetSymbolInfo(((TypePatternSyntax)pattern).Type).Symbol.ToTestDisplayString()); 4188Assert.Equal("System.Int64", model.GetSymbolInfo(((ConstantPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4195Assert.Equal("System.Int32", model.GetSymbolInfo(((ConstantPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4220Assert.Equal("System.Char A", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4227Assert.Equal("System.Char Z", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4246Assert.Equal("System.Char a", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4253Assert.Equal("System.Char z", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4278Assert.Equal("System.Char c0", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4285Assert.Equal("System.Char c9", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4358Assert.Equal("System.Int32 N", model.GetSymbolInfo(((ConstantPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4387Assert.Equal("System.Int64", model.GetSymbolInfo(((TypePatternSyntax)pattern).Type).Symbol.ToTestDisplayString()); 4409Assert.Equal("System.Int32", model.GetSymbolInfo(((TypePatternSyntax)pattern).Type).Symbol.ToTestDisplayString()); 4422Assert.Equal("System.Int64", model.GetSymbolInfo(((ConstantPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4429Assert.Equal("System.Int32", model.GetSymbolInfo(((ConstantPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4454Assert.Equal("System.Char A", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4461Assert.Equal("System.Char Z", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4480Assert.Equal("System.Char a", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4487Assert.Equal("System.Char z", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4512Assert.Equal("System.Char c0", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString()); 4519Assert.Equal("System.Char c9", model.GetSymbolInfo(((RelationalPatternSyntax)pattern).Expression).Symbol.ToTestDisplayString());
Semantics\PatternMatchingTests4.cs (2)
1018Assert.Equal("void C1.Deconstruct(out System.Int32 X, out System.Int32 Y)", symbolInfo.Symbol.ToTestDisplayString()); 1022Assert.Null(symbolInfo.Symbol);
Semantics\PatternMatchingTests5.cs (16)
1114Assert.Equal("P P.Y", xySymbol.Symbol.ToTestDisplayString()); 1119Assert.Equal("P P.X { get; }", xSymbol.Symbol.ToTestDisplayString()); 1124Assert.Equal("P P.Y", yNameSymbol.Symbol.ToTestDisplayString()); 1132Assert.Equal("P P.X { get; }", yxSymbol.Symbol.ToTestDisplayString()); 1137Assert.Equal("P P.Y", ySymbol.Symbol.ToTestDisplayString()); 1142Assert.Equal("P P.X { get; }", xNameSymbol.Symbol.ToTestDisplayString()); 1194Assert.Null(xSymbol.Symbol); 1204Assert.Null(ySymbol.Symbol); 1245Assert.Null(xSymbol.Symbol); 1253Assert.Null(ySymbol.Symbol); 1297Assert.Equal("C S.Y", xySymbol.Symbol.ToTestDisplayString()); 1305Assert.Equal("S? C.X { get; }", xSymbol.Symbol.ToTestDisplayString()); 1313Assert.Equal("C S.Y", yNameSymbol.Symbol.ToTestDisplayString()); 1324Assert.Equal("S? C.X { get; }", yxSymbol.Symbol.ToTestDisplayString()); 1332Assert.Equal("C S.Y", ySymbol.Symbol.ToTestDisplayString()); 1340Assert.Equal("S? C.X { get; }", xNameSymbol.Symbol.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Features (80)
AddImport\CSharpAddImportFeatureService.cs (1)
276=> InfoBoundSuccessfully(symbolInfo.Symbol);
ChangeSignature\CSharpChangeSignatureService.cs (6)
155var typeSymbol = semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol; 174return (symbolInfo.Symbol ?? symbolInfo.CandidateSymbols.FirstOrDefault(), parameterIndex); 416symbolInfo.Symbol is IMethodSymbol { MethodKind: MethodKind.ReducedExtension }, 573if (symbolInfo.Symbol == null) 629return IsParamsArrayExpandedHelper(symbolInfo.Symbol, argumentCount, lastArgumentIsNamed, semanticModel, lastArgumentExpression, cancellationToken); 872.Select(n => semanticModel.GetSymbolInfo(n, cancellationToken).Symbol)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
172var symbol = semanticModel.GetSymbolInfo(node, cancellationToken).Symbol as IMethodSymbol; 312var symbol = semanticModel.GetSymbolInfo(id).Symbol;
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
199if (semanticModel.GetSymbolInfo(o, cancellationToken).Symbol is IMethodSymbol { IsConditional: true })
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
461return model.GetSymbolInfo(name).Symbol is
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
106var symbol = semanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol;
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
218var leftSymbol = semanticModel.GetSymbolInfo(parent.Container, cancellationToken).Symbol;
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
297var symbol = semanticModel.GetSymbolInfo(previousToken.Parent, cancellationToken).Symbol;
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
74var symbol = semanticModel.GetSymbolInfo(name, cancellationToken).Symbol as ITypeSymbol;
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (4)
89ForEachInfo.SemanticModel.GetSymbolInfo(assignmentExpression.Left, cancellationToken).Symbol, 90ForEachInfo.SemanticModel.GetSymbolInfo(_modifyingExpression, cancellationToken).Symbol) && 114var expresisonSymbol = ForEachInfo.SemanticModel.GetSymbolInfo(_modifyingExpression, cancellationToken).Symbol; 119expresisonSymbol, ForEachInfo.SemanticModel.GetSymbolInfo(returnStatement.Expression, cancellationToken).Symbol))
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (1)
248semanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol is IMethodSymbol methodSymbol &&
ConvertLinq\ConvertForEachToLinqQuery\ToToListConverter.cs (1)
36ForEachInfo.SemanticModel.GetSymbolInfo(objectCreationExpression.Type, cancellationToken).Symbol is ITypeSymbol typeSymbol &&
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
308if (_semanticModel.GetSymbolInfo(invocationExpression, _cancellationToken).Symbol is IMethodSymbol methodSymbol && 347if (_semanticModel.GetSymbolInfo(invocationExpression, _cancellationToken).Symbol is IMethodSymbol methodSymbol &&
ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
262var expressionType = _semanticModel.GetSymbolInfo(node.Expression).Symbol.GetSymbolType();
ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
89var symbol = semanticModel.GetSymbolInfo(_assignmentTargetOpt).Symbol;
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
336_localSymbol.Equals(_semanticModel.GetSymbolInfo(identifierName, _cancellationToken).Symbol))
CSharpAsAndNullCheckDiagnosticAnalyzer.cs (5)
165var asOperand = semanticModel.GetSymbolInfo(asExpression.Left, cancellationToken).Symbol; 182asOperand.Equals(semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol) && 219localSymbol.Equals(semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol)) 239localSymbol.Equals(semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol)) 321localSymbol = semanticModel.GetSymbolInfo(identifier).Symbol as ILocalSymbol;
CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
75if (semanticModel.GetSymbolInfo(invocationExpression, cancellationToken).Symbol is not IMethodSymbol methodSymbol)
CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
34var typeSymbol = model.GetSymbolInfo(typeOfExpression.Type, cancellationToken).Symbol.GetSymbolType();
CSharpDeclareAsNullableCodeFixProvider.cs (3)
79var symbol = model.GetSymbolInfo(assignment.Left).Symbol; 192var symbol = model.GetSymbolInfo(assignment.Left, cancellationToken).Symbol; 234var symbol = model.GetSymbolInfo(invocation.Expression, cancellationToken).Symbol;
CSharpInlineDeclarationCodeFixProvider.cs (2)
348var previousSymbol = semanticModel.GetSymbolInfo(nodeToReplace, cancellationToken).Symbol; 376if (!SymbolEquivalenceComparer.Instance.Equals(previousSymbol, updatedSymbolInfo.Symbol))
CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
125if (semanticModel.GetSymbolInfo(argumentExpression, cancellationToken).Symbol is not ILocalSymbol outLocalSymbol) 358var symbol = semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol;
CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (5)
131if (lambdaSymbolInfo.Symbol is not IMethodSymbol lambdaMethod) 135if (invokedSymbolInfo.Symbol is not IMethodSymbol invokedMethod) 188if (rewrittenSymbolInfo.Symbol is not IMethodSymbol rewrittenMethod || 229var method1 = semanticModel1.GetSymbolInfo(node1, cancellationToken).Symbol as IMethodSymbol; 230var method2 = semanticModel2.GetSymbolInfo(node2, cancellationToken).Symbol as IMethodSymbol;
CSharpUseAutoPropertyAnalyzer.cs (1)
125AddIneligibleField(symbolInfo.Symbol);
CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (2)
196var symbol = semanticModel.GetSymbolInfo(binaryExpression, cancellationToken).Symbol; 213var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
Debugging\CSharpProximityExpressionsService.cs (3)
65if (info.Symbol == null) 72if (info.Symbol.Kind == SymbolKind.Local) 74var statement = info.Symbol.Locations.First().FindToken(cancellationToken).GetAncestor<StatementSyntax>();
DocumentHighlighting\CSharpDocumentHighlightsService.cs (1)
66var boundSymbol = semanticModel.GetSymbolInfo(type, cancellationToken).Symbol;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (14)
210(model.GetSymbolInfo(nameSyntax, cancellationToken).Symbol?.Equals(localOrParameter) ?? false) 1442return symbolInfo.Symbol; 1509return MemberSignaturesEquivalent(oldQueryClauseInfo.CastInfo.Symbol, newQueryClauseInfo.CastInfo.Symbol) && 1510MemberSignaturesEquivalent(oldQueryClauseInfo.OperationInfo.Symbol, newQueryClauseInfo.OperationInfo.Symbol); 1517return MemberSignaturesEquivalent(oldOrderingInfo.Symbol, newOrderingInfo.Symbol); 1526return oldSelectInfo.Symbol == null || 1527newSelectInfo.Symbol == null || 1528MemberSignaturesEquivalent(oldSelectInfo.Symbol, newSelectInfo.Symbol); 1533return MemberSignaturesEquivalent(oldGroupByInfo.Symbol, newGroupByInfo.Symbol, GroupBySignatureComparer);
GenerateConstructor\CSharpGenerateConstructorService.cs (1)
193return semanticModel.GetSymbolInfo(constructorDeclarationSyntax.Initializer, cancellationToken).Symbol as IMethodSymbol;
GenerateType\CSharpGenerateTypeService.cs (4)
225var leftSymbol = semanticModel.GetSymbolInfo(((MemberAccessExpressionSyntax)nameOrMemberAccessExpression).Expression, cancellationToken).Symbol; 273var leftSymbol = semanticModel.GetSymbolInfo(parent.Left, cancellationToken).Symbol; 465var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol; 580if (enclosingNamespaceSymbol.Symbol is INamespaceSymbol namespaceSymbol)
NullableImpactingSpanWalker.cs (2)
152if (symbolInfo.Symbol.IsKind(SymbolKind.Namespace)) 157else if (symbolInfo.Symbol is INamedTypeSymbol { IsValueType: true, IsGenericType: false })
Rename\CSharpRenameIssuesService.cs (1)
43SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol;
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (1)
299if (_parameter.Equals(_semanticModel.GetSymbolInfo(node).Symbol))
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
109var selectedItem = TryGetSelectedIndex(accessibleConstructors, symbolInfo.Symbol);
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (1)
108var candidates = semanticModel.GetSymbolInfo(constructorInitializer, cancellationToken).Symbol is IMethodSymbol exactSymbol
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (1)
107var candidates = symbolInfo.Symbol is IMethodSymbol exactMatch
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (1)
101var candidates = semanticModel.GetSymbolInfo(objectCreationExpression, cancellationToken).Symbol is IMethodSymbol exactMatch
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
101var currentConstructor = semanticModel.GetSymbolInfo(baseTypeSyntax, cancellationToken).Symbol;
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (4)
IOperation\IOperationTests.cs (1)
721.ForAll(_ => Assert.Equal("System.String System.String.op_Addition(System.String left, System.String right)", model.GetSymbolInfo(fieldInitializer).Symbol.ToTestDisplayString(includeNonNullable: false)));
IOperation\IOperationTests_IVariableDeclaration.cs (3)
942Assert.NotNull(invocInfo.Symbol); 943Assert.Equal(SymbolKind.Method, invocInfo.Symbol.Kind); 944Assert.Equal("M2", invocInfo.Symbol.MetadataName);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1015)
Semantics\AccessCheckTests.cs (3)
762IDiscardSymbol kdiscard = (IDiscardSymbol)model.GetSymbolInfo(discards[0]).Symbol; 763IDiscardSymbol adiscard = (IDiscardSymbol)model.GetSymbolInfo(discards[1]).Symbol; 911IMethodSymbol IntegerPlus = model.GetSymbolInfo(tree.GetRoot().DescendantNodes().OfType<BinaryExpressionSyntax>().Single()).Symbol as IMethodSymbol;
Semantics\AnonymousFunctionTests.cs (6)
987var anonymousMethod = (IMethodSymbol)semanticModel.GetSymbolInfo(anonymousMethodSyntax).Symbol!; 988var simpleLambda = (IMethodSymbol)semanticModel.GetSymbolInfo(simpleLambdaSyntax).Symbol!; 989var parenthesizedLambda = (IMethodSymbol)semanticModel.GetSymbolInfo(parenthesizedLambdaSyntax).Symbol!; 1021var anonymousMethod = (IMethodSymbol)semanticModel.GetSymbolInfo(anonymousMethodSyntax).Symbol!; 1022var simpleLambda = (IMethodSymbol)semanticModel.GetSymbolInfo(simpleLambdaSyntax).Symbol!; 1023var parenthesizedLambda = (IMethodSymbol)semanticModel.GetSymbolInfo(parenthesizedLambdaSyntax).Symbol!;
Semantics\ArglistTests.cs (1)
965Assert.Equal("TypedReference", info.Symbol.Name);
Semantics\BindingAsyncTests.cs (3)
59Assert.True(((IMethodSymbol)model.GetSymbolInfo(simple).Symbol).IsAsync); 65Assert.True(((IMethodSymbol)model.GetSymbolInfo(paren).Symbol).IsAsync); 88Assert.True(((IMethodSymbol)model.GetSymbolInfo(del).Symbol).IsAsync);
Semantics\BindingTests.cs (19)
2336Assert.Null(symbolInfo.Symbol); 2355Assert.Null(symbolInfo.Symbol); 2698Assert.Equal("void NS.A.B<System.String>.M0()", m0Symbol.Symbol.ToTestDisplayString()); 2710Assert.Equal("void NS.A.B<System.String>.M1()", m1Symbol.Symbol.ToTestDisplayString()); 2754Assert.Equal("void A.MyMethod(System.Int32 a)", model.GetSymbolInfo(identifiers[0]).Symbol.ToTestDisplayString()); 2757Assert.Equal("void A.MyMethod(System.Int64 a)", model.GetSymbolInfo(identifiers[1]).Symbol.ToTestDisplayString()); 2760Assert.Equal("void A.MyMethod(System.Single a)", model.GetSymbolInfo(identifiers[2]).Symbol.ToTestDisplayString()); 2763Assert.Equal("void A.MyMethod(System.Double a)", model.GetSymbolInfo(identifiers[3]).Symbol.ToTestDisplayString()); 2809Assert.Equal("void NS.A.B<System.String>.M0<System.String>()", m0Symbol.Symbol.ToTestDisplayString()); 2821Assert.Equal("void NS.A.B<System.String>.M1<System.String>()", m1Symbol.Symbol.ToTestDisplayString()); 2899var symbol2 = model.GetSymbolInfo(id).Symbol; 2941var symbol2 = model.GetSymbolInfo(id).Symbol; 3013Assert.Null(symbolInfo1.Symbol); 3093Assert.Null(symbolInfo1.Symbol); 3166Assert.Null(symbolInfo1.Symbol); 3251Assert.Null(symbolInfo1.Symbol); 3480Assert.Null(symbolInfo2.Symbol); 3485Assert.Null(symbolInfo1.Symbol); 3654Assert.Equal("System.Object A.G(System.String s)", info.Symbol.ToTestDisplayString());
Semantics\ColorColorTests.cs (48)
600Assert.Equal(SymbolKind.Method, parentInfo.Symbol.Kind); 601Assert.Equal("void E.M(params System.Int32[] a)", parentInfo.Symbol.ToTestDisplayString()); 640Assert.Equal(SymbolKind.Local, info.Symbol.Kind); 641Assert.Equal("Color Color", info.Symbol.ToTestDisplayString()); 647Assert.Null(parentInfo.Symbol); // the lexically first matching method 1069Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 1070Assert.Equal("E F.E { get; set; }", info.Symbol.ToTestDisplayString()); 1077Assert.Null(parentInfo.Symbol); 1115Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 1116Assert.Equal("E F.E { get; set; }", info.Symbol.ToTestDisplayString()); 1123Assert.Null(parentInfo.Symbol); 1161Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 1162Assert.Equal("E F.E { get; set; }", info.Symbol.ToTestDisplayString()); 1168Assert.Null(parentInfo.Symbol); 1206Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 1207Assert.Equal("E F.E { get; set; }", info.Symbol.ToTestDisplayString()); 1213Assert.Null(parentInfo.Symbol); 1247Assert.Null(info.Symbol); 1257Assert.Equal(WellKnownMemberNames.DelegateInvokeName, parentInfo.Symbol.Name); // Succeeded even though the receiver has an error. 1284Assert.Equal(SymbolKind.Field, info.Symbol.Kind); 1285Assert.Equal("Color.Color", info.Symbol.ToTestDisplayString()); 1292Assert.Null(parentInfo.Symbol); 1788Assert.Equal("Lifetime", actualSymbol.Symbol.ToTestDisplayString()); 1789Assert.Equal(SymbolKind.NamedType, actualSymbol.Symbol.Kind); 1822Assert.Equal("Lifetime", actualSymbol.Symbol.ToTestDisplayString()); 1823Assert.Equal(SymbolKind.NamedType, actualSymbol.Symbol.Kind); 1847Assert.Equal(exprSymbolKind, info.Symbol.Kind); 1848Assert.Equal(exprDisplayString, info.Symbol.ToTestDisplayString()); 1854Assert.Equal(parentSymbolKind, parentInfo.Symbol.Kind); 1855Assert.Equal(parentDisplayString, parentInfo.Symbol.ToTestDisplayString()); 1887Assert.Equal("E", symbolInfo.Symbol.ToTestDisplayString()); 1888Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind); 1897Assert.Equal("E E", symbolInfo.Symbol.ToTestDisplayString()); 1901Assert.Equal("E", symbolInfo.Symbol.ToTestDisplayString()); 1902Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind); 1944Assert.Equal("? E", symbolInfo.Symbol.ToTestDisplayString()); 1945Assert.Equal(SymbolKind.Local, symbolInfo.Symbol.Kind); 1954Assert.Equal("? E", symbolInfo.Symbol.ToTestDisplayString()); 1958Assert.Equal("? E", symbolInfo.Symbol.ToTestDisplayString()); 1959Assert.Equal(SymbolKind.Local, symbolInfo.Symbol.Kind); 2001Assert.Equal("E", symbolInfo.Symbol.ToTestDisplayString()); 2002Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind); 2011Assert.Equal("E E", symbolInfo.Symbol.ToTestDisplayString()); 2015Assert.Equal("E", symbolInfo.Symbol.ToTestDisplayString()); 2016Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind); 2051Assert.Equal("? E", symbolInfo.Symbol.ToTestDisplayString()); 2060Assert.Equal("? E", symbolInfo.Symbol.ToTestDisplayString()); 2064Assert.Equal("? E", symbolInfo.Symbol.ToTestDisplayString());
Semantics\ConditionalOperatorTests.cs (10)
1327Assert.Equal("event System.Action TestClass.test", model.GetSymbolInfo(memberBinding).Symbol.ToTestDisplayString()); 1328Assert.Equal("event System.Action TestClass.test", model.GetSymbolInfo(memberBinding.Name).Symbol.ToTestDisplayString()); 1330Assert.Null(model.GetSymbolInfo(access).Symbol); 1383Assert.Equal("event System.Action TestClass.test", model.GetSymbolInfo(memberBinding).Symbol.ToTestDisplayString()); 1384Assert.Equal("event System.Action TestClass.test", model.GetSymbolInfo(memberBinding.Name).Symbol.ToTestDisplayString()); 1385Assert.Equal("void System.Action.Invoke()", model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()); 1387Assert.Null(model.GetSymbolInfo(access).Symbol); 1428Assert.Equal("event System.Action TestClass.test", model.GetSymbolInfo(memberBinding).Symbol.ToTestDisplayString()); 1429Assert.Equal("event System.Action TestClass.test", model.GetSymbolInfo(memberBinding.Name).Symbol.ToTestDisplayString()); 1431Assert.Null(model.GetSymbolInfo(access).Symbol);
Semantics\DeconstructionTests.cs (91)
3947var symbol = si.Symbol; 4179Assert.Same(x1, model.GetSymbolInfo(refs.Where(r => r.Identifier.ValueText == "x1").Single()).Symbol); 4184Assert.Same(x2, model.GetSymbolInfo(refs.Where(r => r.Identifier.ValueText == "x2").Single()).Symbol); 4268Assert.Null(symbolInfo.Symbol); 4280Assert.Equal("(var a, var b)", symbolInfo.Symbol.ToTestDisplayString()); 4291Assert.Equal("var c", model.GetSymbolInfo(declarations[1]).Symbol.ToTestDisplayString()); 4298Assert.Null(symbolInfo.Symbol); 4308Assert.Equal("System.Int32 d", model.GetSymbolInfo(declarations[2]).Symbol.ToTestDisplayString()); 4314Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4323Assert.Null(symbolInfo.Symbol); 4403Assert.Null(symbolInfo.Symbol); 4411Assert.Equal("(var a, var b)", symbolInfo.Symbol.ToTestDisplayString()); 4422Assert.Equal("var Script.c", model.GetSymbolInfo(declarations[1]).Symbol.ToTestDisplayString()); 4429Assert.Null(symbolInfo.Symbol); 4439Assert.Equal("System.Int32 Script.d", model.GetSymbolInfo(declarations[2]).Symbol.ToTestDisplayString()); 4445Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4454Assert.Null(symbolInfo.Symbol); 4527Assert.Null(symbolInfo.Symbol); 4539Assert.Equal("(var, var)", symbolInfo.Symbol.ToTestDisplayString()); 4551Assert.Null(symbolInfo.Symbol); 4560Assert.Null(symbolInfo.Symbol); 4571Assert.Null(symbolInfo.Symbol); 4579Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4588Assert.Null(symbolInfo.Symbol); 4677Assert.Null(symbolInfo.Symbol); 4685Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4695Assert.Equal("System.Int32 c", model.GetSymbolInfo(declarations[1]).Symbol.ToTestDisplayString()); 4701Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4771Assert.Null(symbolInfo.Symbol); 4779Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4789Assert.Equal("System.Int32 Script.c", model.GetSymbolInfo(declarations[1]).Symbol.ToTestDisplayString()); 4795Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4849Assert.Null(symbolInfo.Symbol); 4857Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4868Assert.Null(symbolInfo.Symbol); 4876Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4952Assert.Equal("System.Int32 c", model.GetSymbolInfo(declaration).Symbol.ToTestDisplayString()); 4958Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 4998Assert.Equal("System.Int32 Script.c", model.GetSymbolInfo(declaration).Symbol.ToTestDisplayString()); 5004Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 5057Assert.Null(symbolInfo.Symbol); 5065Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 5217Assert.Null(symbolInfo.Symbol); 5225Assert.Equal("(var a, var b)", symbolInfo.Symbol.ToTestDisplayString()); 5236Assert.Equal("var c", model.GetSymbolInfo(declarations[1]).Symbol.ToTestDisplayString()); 5243Assert.Null(symbolInfo.Symbol); 5253Assert.Equal("System.Int32 d", model.GetSymbolInfo(declarations[2]).Symbol.ToTestDisplayString()); 5259Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 5271Assert.Null(symbolInfo.Symbol); 5281Assert.Null(symbolInfo.Symbol); 5361Assert.Null(symbolInfo.Symbol); 5369Assert.Equal("(var a, var b)", symbolInfo.Symbol.ToTestDisplayString()); 5380Assert.Equal("var Script.c", model.GetSymbolInfo(declarations[1]).Symbol.ToTestDisplayString()); 5387Assert.Null(symbolInfo.Symbol); 5397Assert.Equal("System.Int32 Script.d", model.GetSymbolInfo(declarations[2]).Symbol.ToTestDisplayString()); 5403Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 5415Assert.Null(symbolInfo.Symbol); 5425Assert.Null(symbolInfo.Symbol); 5498Assert.Null(symbolInfo.Symbol); 5506Assert.Equal("(var, var)", symbolInfo.Symbol.ToTestDisplayString()); 5518Assert.Null(symbolInfo.Symbol); 5527Assert.Null(symbolInfo.Symbol); 5538Assert.Null(symbolInfo.Symbol); 5546Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 5558Assert.Null(symbolInfo.Symbol); 5568Assert.Null(symbolInfo.Symbol); 5685Assert.Null(symbolInfo.Symbol); 5693Assert.Equal("((var a, var b), var c)", symbolInfo.Symbol.ToTestDisplayString()); 5703Assert.Equal("System.Int32 d", model.GetSymbolInfo(declarations[1]).Symbol.ToTestDisplayString()); 5709Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 5718Assert.Null(symbolInfo.Symbol); 5795Assert.Null(symbolInfo.Symbol); 5803Assert.Equal("((var a, var b), var c)", symbolInfo.Symbol.ToTestDisplayString()); 5813Assert.Equal("System.Int32 Script.d", model.GetSymbolInfo(declarations[1]).Symbol.ToTestDisplayString()); 5819Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 5828Assert.Null(symbolInfo.Symbol); 5898Assert.Null(symbolInfo.Symbol); 5906Assert.Equal("((var, var), var)", symbolInfo.Symbol.ToTestDisplayString()); 5917Assert.Null(symbolInfo.Symbol); 5925Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()); 5934Assert.Null(symbolInfo.Symbol); 5995Assert.Equal(symbols.Symbol, main.GetPublicSymbol()); 6005Assert.Null(symbols.Symbol); 6038Assert.Equal(symbols.Symbol, main.GetPublicSymbol()); 6048Assert.Null(symbols.Symbol); 6078Assert.Equal(symbols.Symbol, main.GetPublicSymbol()); 6088Assert.Null(symbols.Symbol); 6120Assert.Null(symbols.Symbol); 6130Assert.Null(symbols.Symbol); 6160Assert.Equal(symbols.Symbol, main.GetPublicSymbol()); 6170Assert.Null(symbols.Symbol);
Semantics\DelegateTypeTests.cs (6)
901var method = (IMethodSymbol)symbolInfo.Symbol!; 944var method = (IMethodSymbol)symbolInfo.Symbol!; 1321Assert.Null(symbolInfo.Symbol); 1416Assert.Null(symbolInfo.Symbol); 5342var method = (IMethodSymbol)symbolInfo.Symbol!; 11061var symbol = model.GetSymbolInfo(variable).Symbol;
Semantics\DynamicTests.cs (5)
3551Assert.Equal("void Test.Goo<dynamic>(System.Collections.Generic.IEnumerable<dynamic> source, System.Action<dynamic> action)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 3584Assert.Equal("void Test.Goo<dynamic>(System.Action<dynamic> action, System.Collections.Generic.IEnumerable<dynamic> source)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 3612Assert.Equal("System.Object Program.Goo<System.Object>(System.Action<System.Object, System.Object> x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 3640Assert.Equal("System.Object Program.Goo<System.Object>(System.Action<System.Object, System.Object> x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 3691Assert.Equal("dynamic Program.Goo<dynamic>(System.Func<dynamic, dynamic> x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString());
Semantics\ExpressionBodiedMemberTests.cs (15)
478Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 509Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 538Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 547Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node2).Symbol.ToTestDisplayString()); 578Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 587Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node2).Symbol.ToTestDisplayString()); 652Assert.Null(model.GetSymbolInfo(node).Symbol); 683Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 714Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 745Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 780Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 811Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 846Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 881Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 920Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString());
Semantics\ForEachTests.cs (1)
2895Assert.Equal(localSymbolType, info.Symbol);
Semantics\FunctionPointerTests.cs (12)
1594var methodSymbol = (IMethodSymbol)model.GetSymbolInfo(invocation).Symbol!; 1643model.GetSymbolInfo(m1Invocation).Symbol.ToTestDisplayString()); 1676model.GetSymbolInfo(m1Invocation).Symbol.ToTestDisplayString()); 1709model.GetSymbolInfo(m1Invocation).Symbol.ToTestDisplayString()); 1754var methodSymbol = (IMethodSymbol)model.GetSymbolInfo(invocation).Symbol!; 1803model.GetSymbolInfo(m1Invocation).Symbol.ToTestDisplayString()); 1836model.GetSymbolInfo(m1Invocation).Symbol.ToTestDisplayString()); 1869model.GetSymbolInfo(m1Invocation).Symbol.ToTestDisplayString()); 1915var m1InvocationSymbol = (IMethodSymbol)model.GetSymbolInfo(invocation).Symbol!; 2037symbol.Symbol.ToTestDisplayString()); 2266return symbolInfo.Symbol ?? symbolInfo.CandidateSymbols.Single(); 2339return symbolInfo.Symbol ?? symbolInfo.CandidateSymbols.Single();
Semantics\GenericConstraintsTests.cs (5)
2881var symbol = (IMethodSymbol)model.GetSymbolInfo(value).Symbol; 3141var inferredMethod = (IMethodSymbol)model.GetSymbolInfo(call).Symbol; 3171var inferredMethod = (IMethodSymbol)model.GetSymbolInfo(call).Symbol; 3197var inferredMethod = (IMethodSymbol)model.GetSymbolInfo(call).Symbol; 3226var inferredMethod = (IMethodSymbol)model.GetSymbolInfo(call).Symbol;
Semantics\ImplicitlyTypeArraysTests.cs (3)
70Assert.Equal(SymbolKind.Local, sym.Symbol.Kind); 97Assert.Equal("System.String[]", symInfo.Symbol.ToTestDisplayString()); 98Assert.Equal(SymbolKind.ArrayType, symInfo.Symbol.Kind);
Semantics\ImplicitObjectCreationTests.cs (26)
67Assert.Equal(symbol, model.GetSymbolInfo(@new).Symbol.ToTestDisplayString()); 142Assert.Equal(symbol, model.GetSymbolInfo(@new).Symbol.ToTestDisplayString()); 189Assert.Equal(symbol, model.GetSymbolInfo(@new).Symbol.ToTestDisplayString()); 241Assert.Equal(symbol, model.GetSymbolInfo(@new).Symbol.ToTestDisplayString()); 847Assert.Equal("CoClassType..ctor()", model.GetSymbolInfo(@new).Symbol.ToTestDisplayString()); 888Assert.Equal("GenericCoClassType<System.Int32, System.String>..ctor(System.String x)", model.GetSymbolInfo(@new).Symbol.ToTestDisplayString()); 1717Assert.Equal(symbol, model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()); 1871Assert.Equal("C..ctor()", model.GetSymbolInfo(def).Symbol.ToTestDisplayString()); 1901Assert.Equal("S..ctor(System.Int32 i)", model.GetSymbolInfo(def).Symbol.ToTestDisplayString()); 1931Assert.Equal("S..ctor(System.Int32 i)", model.GetSymbolInfo(def).Symbol.ToTestDisplayString()); 2042Assert.Equal("System.Object..ctor()", model.GetSymbolInfo(@new).Symbol?.ToTestDisplayString()); 2049Assert.Equal("System.Object..ctor()", model.GetSymbolInfo(newObject).Symbol?.ToTestDisplayString()); 2077Assert.Equal("System.Object..ctor()", model.GetSymbolInfo(@new).Symbol?.ToTestDisplayString()); 2084Assert.Equal("System.Object..ctor()", model.GetSymbolInfo(newObject).Symbol?.ToTestDisplayString()); 2136Assert.Null(model.GetSymbolInfo(@new).Symbol); 2223Assert.Null(model.GetSymbolInfo(def).Symbol); 2519Assert.Equal("System.Exception..ctor(System.String message)", model.GetSymbolInfo(def).Symbol.ToTestDisplayString()); 2571Assert.Equal("C..ctor()", model.GetSymbolInfo(def).Symbol.ToTestDisplayString()); 2934Assert.Equal(symbol, model.GetSymbolInfo(@new).Symbol.ToTestDisplayString()); 4196Assert.Equal("System.Int32..ctor()", symbolInfo.Symbol.ToTestDisplayString()); 4539Assert.NotNull(symbolInfo.Symbol); 4540Assert.Equal("void X.Add(System.String x)", symbolInfo.Symbol.ToTestDisplayString()); 4546Assert.NotNull(symbolInfo.Symbol); 4547Assert.Equal("void X.Add(System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 4580Assert.NotNull(symbolInfo.Symbol); 4581Assert.Equal("System.Int32 aParameter", symbolInfo.Symbol.ToTestDisplayString());
Semantics\IndexAndRangeTests.cs (18)
899Assert.Null(model.GetSymbolInfo(expression).Symbol); 920Assert.Equal("System.Index..ctor(System.Int32 value, [System.Boolean fromEnd = false])", model.GetSymbolInfo(expression).Symbol.ToTestDisplayString()); 941Assert.Equal("System.Index..ctor(System.Int32 value, [System.Boolean fromEnd = false])", model.GetSymbolInfo(expression).Symbol.ToTestDisplayString()); 1125Assert.Null(model.GetSymbolInfo(expressions[0]).Symbol); 1130Assert.Equal(RangeStartAtSignature, model.GetSymbolInfo(expressions[1]).Symbol.ToTestDisplayString()); 1135Assert.Equal(RangeEndAtSignature, model.GetSymbolInfo(expressions[2]).Symbol.ToTestDisplayString()); 1140Assert.Equal(RangeAllSignature, model.GetSymbolInfo(expressions[3]).Symbol.ToTestDisplayString()); 1252Assert.Equal(RangeCtorSignature, model.GetSymbolInfo(expression).Symbol.ToTestDisplayString()); 1285Assert.Equal(RangeCtorSignature, model.GetSymbolInfo(expression).Symbol.ToTestDisplayString()); 1318Assert.Equal(RangeCtorSignature, model.GetSymbolInfo(expression).Symbol.ToTestDisplayString()); 1344Assert.Equal(RangeCtorSignature, model.GetSymbolInfo(expressions[0]).Symbol.ToTestDisplayString()); 1349Assert.Equal(RangeStartAtSignature, model.GetSymbolInfo(expressions[1]).Symbol.ToTestDisplayString()); 1354Assert.Equal(RangeEndAtSignature, model.GetSymbolInfo(expressions[2]).Symbol.ToTestDisplayString()); 1359Assert.Equal(RangeAllSignature, model.GetSymbolInfo(expressions[3]).Symbol.ToTestDisplayString()); 1387Assert.Equal(RangeCtorSignature, model.GetSymbolInfo(expressions[0]).Symbol.ToTestDisplayString()); 1392Assert.Equal(RangeStartAtSignature, model.GetSymbolInfo(expressions[1]).Symbol.ToTestDisplayString()); 1397Assert.Equal(RangeEndAtSignature, model.GetSymbolInfo(expressions[2]).Symbol.ToTestDisplayString()); 1402Assert.Equal(RangeAllSignature, model.GetSymbolInfo(expressions[3]).Symbol.ToTestDisplayString());
Semantics\InitOnlyMemberTests.cs (3)
2517var method = (IMethodSymbol)model.GetSymbolInfo(invocation).Symbol; 3156Assert.Equal("_p", symbolSpeculation.Symbol.Name); 3194Assert.Equal("System.Int32 C.P1 { get; set; }", model.GetSymbolInfo(node).Symbol.ToTestDisplayString());
Semantics\InteractiveUsingTests.cs (3)
93Assert.Equal(typeSymbol, model.GetSymbolInfo(syntax.Name).Symbol); 123Assert.Equal(typeSymbol, model.GetSymbolInfo(syntax.Name).Symbol); 587SpeculativeBindingOption.BindAsExpression).Symbol;
Semantics\IteratorTests.cs (2)
491Assert.Equal("System.Collections.Generic.KeyValuePair<TKey, TValue>..ctor(TKey key, TValue value)", symbolInfo.Symbol.ToTestDisplayString()); 529Assert.Null(symbolInfo.Symbol);
Semantics\LambdaDiscardParametersTests.cs (8)
112Assert.Null(model.GetSymbolInfo(underscore).Symbol); 387var lambdas = exprs.Select(e => (IMethodSymbol)model.GetSymbolInfo(e).Symbol).ToArray(); 423Assert.Null(model.GetSymbolInfo(underscore).Symbol); 451var localSymbol = model.GetSymbolInfo(underscores[0]).Symbol; 455var parameterSymbol = model.GetSymbolInfo(underscores[1]).Symbol; 484var localSymbol = model.GetSymbolInfo(underscore).Symbol; 516var localSymbol = model.GetSymbolInfo(underscores[0]).Symbol; 520var parameterSymbol = model.GetSymbolInfo(underscores[1]).Symbol;
Semantics\LambdaTests.cs (31)
851var sym = model.GetSymbolInfo(expr).Symbol; 861sym = model.GetSymbolInfo(expr).Symbol; 1178Assert.Null(symbolInfo.Symbol); 1206Assert.Null(symbolInfo.Symbol); 1238Assert.Equal("void System.Collections.Generic.ICollection<C>.Add(C item)", symbolInfo.Symbol.ToTestDisplayString()); 1516Assert.Equal("Program a", symbolInfo.Symbol.ToTestDisplayString()); 1551Assert.Equal("Program a", symbolInfo.Symbol.ToTestDisplayString()); 1585Assert.Equal("Program a", symbolInfo.Symbol.ToTestDisplayString()); 1617Assert.Equal("Program a", symbolInfo.Symbol.ToTestDisplayString()); 1981var lambdaParameters = ((IMethodSymbol)(model.GetSymbolInfo(node1)).Symbol).Parameters; 2997Assert.Null(model.GetSymbolInfo(contentType).Symbol); 3004ISymbol symbol = model.GetSymbolInfo(b).Symbol; 3609var pairs = exprs.Select(e => (e, model.GetSymbolInfo(e).Symbol)).ToArray(); 3878var symbol = (IMethodSymbol)model.GetSymbolInfo(lambda).Symbol; 3935var symbol = model.GetSymbolInfo(attributeSyntax).Symbol; 3966Assert.Equal(attrCtor, attrInfo.Symbol); 3978Assert.Equal(attrCtor, info.Symbol); 4078var symbol = model.GetSymbolInfo(expr).Symbol; 5605var method = (IMethodSymbol)model.GetSymbolInfo(lambdaSyntax).Symbol; 5614Assert.Equal(expectedType, symbolInfo.Symbol); 6186return model.GetSymbolInfo(syntax).Symbol.GetSymbol<LambdaSymbol>(); 6479Assert.Null(model.GetSymbolInfo(parameterUsage).Symbol); 6787Assert.Equal("System.Int32 _", model.GetSymbolInfo(discard).Symbol.ToTestDisplayString()); 6816Assert.Equal("System.String _", model.GetSymbolInfo(underscore).Symbol.ToTestDisplayString()); 6863var lambdas = tree.GetRoot().DescendantNodes().OfType<ParenthesizedLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray(); 7077var lambdaParameter1 = model.GetSymbolInfo(lambdas[0]).Symbol.GetParameters()[0]; 7082var lambdaParameter2 = model.GetSymbolInfo(lambdas[1]).Symbol.GetParameters()[0]; 7978.Select(n => (Node: n, Symbol: (IMethodSymbol)model.GetSymbolInfo(n).Symbol)) 8054var newLambdaSymbol = (IMethodSymbol)speculativeModel.GetSymbolInfo(newLambda).Symbol; 8094var defaultValueSymbol = model.GetSymbolInfo(defaultValue).Symbol; 8099var lhsSymbol = model.GetSymbolInfo(lhs).Symbol;
Semantics\LocalFunctionTests.cs (43)
358Assert.Null(info.Symbol); 400Assert.Equal(attrCtor, attrInfo.Symbol); 413Assert.Equal(attrCtor, info.Symbol); 455Assert.Null(model.GetSymbolInfo(attrArg0).Symbol); 461Assert.Null(model.GetSymbolInfo(attrArg1).Symbol); 619Assert.Equal("System.String s1", model.GetSymbolInfo(arg1.Expression).Symbol.ToTestDisplayString()); 623Assert.Null(model.GetSymbolInfo(arg2.Expression).Symbol); 627Assert.Equal("System.String s2", model.GetSymbolInfo(arg3.Expression).Symbol.ToTestDisplayString()); 672Assert.Null(model.GetSymbolInfo(arg.Expression).Symbol); 726Assert.Equal("System.Boolean C.M2(out System.Int32 x)", model.GetSymbolInfo(arg.Expression).Symbol.ToTestDisplayString()); 1028var symbol = model.GetSymbolInfo(attributeSyntax).Symbol.GetSymbol<MethodSymbol>(); 1061var attrConstructor = (IMethodSymbol)model.GetSymbolInfo(attrSyntax).Symbol; 1776Assert.Null(aSymbolInfo.Symbol); 1797Assert.Null(clsCompliantSymbolInfo.Symbol); 1851Assert.Null(aSymbolInfo.Symbol); 1872Assert.Null(clsCompliantSymbolInfo.Symbol); 4614Assert.Equal(symbol, model.GetSymbolInfo(refs[0]).Symbol); 4615Assert.Null(model.GetSymbolInfo(refs[1]).Symbol); 4616Assert.Null(model.GetSymbolInfo(refs[2]).Symbol); 4655Assert.Same(symbol, model.GetSymbolInfo(refs[0]).Symbol); 4881Assert.Null(model.GetSymbolInfo(b2).Symbol); 4884var b1Symbol = model.GetSymbolInfo(b1).Symbol; 6279var symbol = model.GetSymbolInfo(expr).Symbol; 6300var symbol = model.GetSymbolInfo(expr).Symbol; 6328var symbol = model.GetSymbolInfo(expr).Symbol; 6364var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 6367symbol = model.GetSymbolInfo(exprs[1]).Symbol; 6408var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 6411symbol = model.GetSymbolInfo(exprs[1]).Symbol; 6414symbol = model.GetSymbolInfo(exprs[2]).Symbol; 6455var symbol = model.GetSymbolInfo(exprs[0]).Symbol; 6458symbol = model.GetSymbolInfo(exprs[1]).Symbol; 6461symbol = model.GetSymbolInfo(exprs[2]).Symbol; 6957var actualSymbols = nodes.Select(n => model.GetSymbolInfo(n.Left).Symbol).Select(s => $"{s.Kind}: {s.ToTestDisplayString()}").ToArray(); 7291Assert.Equal(SymbolKind.TypeParameter, symbolInfo.Symbol.Kind); 7295Assert.Null(symbolInfo.Symbol); 7564var symbol = model.GetSymbolInfo(tParameterUsage).Symbol; 8609var symbol = model.GetSymbolInfo(parameterUsage).Symbol; 8663Assert.Null(symbolInfo.Symbol); 8872Assert.Equal(SymbolKind.Parameter, symbolInfo.Symbol.Kind); 8876Assert.Null(symbolInfo.Symbol); 9479Assert.Null(model.GetSymbolInfo(node).Symbol); 10099Assert.Null(model.GetSymbolInfo(node).Symbol);
Semantics\LockTests.cs (6)
53Assert.Equal(localSymbol, lockExprInfo.Symbol); 58Assert.Equal(localSymbol, memberAccessInfo.Symbol); 490Assert.Null(model.GetSymbolInfo(lockStatements[0].Expression).Symbol); 576Assert.Null(model.GetSymbolInfo(lockStatements[0].Expression).Symbol); 703Assert.Null(symbolInfo.Symbol); 707Assert.NotNull(symbolInfo.Symbol);
Semantics\LookupTests.cs (10)
1565var method = (IMethodSymbol)model.GetSymbolInfo(expr).Symbol; 1598var method = (IMethodSymbol)model.GetSymbolInfo(expr).Symbol; 1603method = (IMethodSymbol)model.GetSymbolInfo(expr).Symbol; 1729Assert.Equal(propertyLP.GetPublicSymbol(), model.GetSymbolInfo(syntaxes[0]).Symbol); 1730Assert.Equal(propertyRQ.GetPublicSymbol(), model.GetSymbolInfo(syntaxes[1]).Symbol); 2018Assert.Equal(symbolInfo.Symbol.GetSymbol(), m); 2048Assert.Equal(symbolInfo.Symbol.GetSymbol(), m); 2078Assert.Equal(symbolInfo.Symbol.GetSymbol(), m); 2104Assert.NotNull(symbolInfo.Symbol); 2124Assert.Equal("Attr1<System.String>..ctor(System.String t)", symbol.Symbol.ToTestDisplayString());
Semantics\MethodTypeInferenceTests.cs (5)
842Assert.Null(model.GetSymbolInfo(discard).Symbol); 845Assert.Null(model.GetSymbolInfo(declaration).Symbol); 851var discardSymbol = (IDiscardSymbol)model.GetSymbolInfo(discard).Symbol; 1048var method = (IMethodSymbol)model.GetSymbolInfo(syntax).Symbol; 1078var method = (IMethodSymbol)model.GetSymbolInfo(syntax).Symbol;
Semantics\NamedAndOptionalTests.cs (3)
818Assert.NotNull(symInfo.Symbol); 819Assert.Equal(SymbolKind.Parameter, symInfo.Symbol.Kind); 820Assert.Equal("ss", symInfo.Symbol.Name);
Semantics\NameOfTests.cs (7)
753Assert.Null(symbolInfo.Symbol); 801Assert.Null(symbolInfo.Symbol); 838Assert.Null(symbolInfo.Symbol); 874Assert.NotNull(symbolInfo.Symbol); 920Assert.Null(symbolInfo.Symbol); 953Assert.Null(symbolInfo.Symbol); 1120Assert.Null(symbolInfo.Symbol);
Semantics\NativeIntegerTests.cs (12)
6036var actualOperators = nodes.Select(n => model.GetSymbolInfo(n).Symbol.ToTestDisplayString()).ToArray(); 6084var actualOperators = nodes.Select(n => model.GetSymbolInfo(n).Symbol.ToTestDisplayString()).ToArray(); 9706Assert.Equal(expectedSymbol, symbolInfo.Symbol?.ToDisplayString(SymbolDisplayFormat.TestFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes))); 10083Assert.Equal(expectedSymbol, symbolInfo.Symbol?.ToDisplayString(SymbolDisplayFormat.TestFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes))); 10308Assert.Equal(expectedSymbol, symbolInfo.Symbol?.ToDisplayString(SymbolDisplayFormat.TestFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes))); 12357Assert.Equal(expectedSymbol, symbolInfo.Symbol?.ToDisplayString(SymbolDisplayFormat.TestFormat.WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.UseSpecialTypes))); 15295var nintSymbol = (INamedTypeSymbol)model.GetSymbolInfo(cref).Symbol; 15316var nintSymbol = (INamedTypeSymbol)model.GetSymbolInfo(cref).Symbol; 15339var symbol = (INamedTypeSymbol)model.GetSymbolInfo(cref).Symbol; 15367var symbol = (IFieldSymbol)model.GetSymbolInfo(cref).Symbol; 15390var symbol = (INamedTypeSymbol)model.GetSymbolInfo(cref).Symbol; 15420var symbol = (ITypeSymbol)model.GetSymbolInfo(cref).Symbol;
Semantics\NonTrailingNamedArgumentsTests.cs (21)
48model.GetSymbolInfo(firstInvocation).Symbol.ToTestDisplayString()); 53Assert.Equal(SymbolKind.Parameter, firstASymbol.Symbol.Kind); 54Assert.Equal("a", firstASymbol.Symbol.Name); 55Assert.Equal("void C.M(System.Int32 a, System.Int32 b)", firstASymbol.Symbol.ContainingSymbol.ToTestDisplayString()); 60model.GetSymbolInfo(secondInvocation).Symbol.ToTestDisplayString()); 65Assert.Equal(SymbolKind.Parameter, secondASymbol.Symbol.Kind); 66Assert.Equal("a", secondASymbol.Symbol.Name); 67Assert.Equal("void C.M(System.Int64 b, System.Int64 a)", secondASymbol.Symbol.ContainingSymbol.ToTestDisplayString()); 369Assert.Null(model.GetSymbolInfo(invocation).Symbol); 395Assert.Equal("void C.M<System.Int32, System.String>(System.Int32 a, System.String b)", model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()); 457Assert.Null(model.GetSymbolInfo(invocation).Symbol); 486Assert.Null(model.GetSymbolInfo(invocation).Symbol); 538Assert.Null(symbolInfo.Symbol); 571Assert.Null(model.GetSymbolInfo(invocation).Symbol); 600Assert.Null(model.GetSymbolInfo(invocation).Symbol); 654Assert.Null(model.GetSymbolInfo(invocation).Symbol); 681Assert.Equal("void C.M(System.Int32 x, params System.Int32[] y)", model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()); 712Assert.Null(model.GetSymbolInfo(firstInvocation).Symbol); 747model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()); 779model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()); 953model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString());
Semantics\NullableReferenceTypesTests.cs (64)
1885Assert.Equal("System.String s", model.GetSymbolInfo(suppressions[0]).Symbol.ToTestDisplayString()); 1890Assert.Equal("System.String? s2", model.GetSymbolInfo(suppressions[1]).Symbol.ToTestDisplayString()); 1895Assert.Equal("C<System.String> c", model.GetSymbolInfo(suppressions[2]).Symbol.ToTestDisplayString()); 1900Assert.Equal("C<System.String?> c2", model.GetSymbolInfo(suppressions[3]).Symbol.ToTestDisplayString()); 3688var symbol2 = model.GetSymbolInfo(id).Symbol; 4515var firstCrefSymbol = model.GetSymbolInfo(firstCref).Symbol; 4519var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 4551var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 4583var lastCrefSymbol = model.GetSymbolInfo(lastCref).Symbol; 33046var symbol = model.GetSymbolInfo(outVar).Symbol.GetSymbol<LocalSymbol>(); 33066Assert.Null(model.GetSymbolInfo(variable).Symbol); 53903Assert.Equal("void Program.M<System.Object>(System.Func<System.Object> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 53966Assert.Equal("void Program.M<U>(System.Func<U> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54003Assert.Equal("void Program.M<U>(System.Func<U> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54033Assert.Equal("void Program.M<System.Object>(System.Func<System.Object> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54067Assert.Equal("void Program.M<System.Object>(System.Func<System.Object> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54098Assert.Equal("void Program.M<A>(System.Func<A> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54131Assert.Equal("void Program.M<System.Object>(System.Func<System.Object> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54165Assert.Equal("void Program.M<System.Object>(System.Func<System.Object> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54199Assert.Equal("void Program.M<System.Object>(System.Func<System.Object> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54230Assert.Equal("void Program.M<A>(System.Func<A> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54263Assert.Equal("void Program.M<System.Object>(System.Func<System.Object> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54298Assert.Equal("void Program.M<Program>(System.Func<Program> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54334Assert.Equal("void Program.M<System.Object?>(System.Func<System.Object?> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54409Assert.Equal("System.String? C.Infer<System.String?>(System.String? t1, System.String? t2)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 54412Assert.Equal("System.String? C.Infer<System.String?>(System.String? t1, System.String? t2)", model.GetSymbolInfo(invocationNode2).Symbol.ToTestDisplayString()); 54445Assert.Equal("void Program.M<System.Action>(System.Func<System.Action> t)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 63438var objectSymbol2 = model2.GetSymbolInfo(object2).Symbol; 68366var discard1 = model.GetSymbolInfo(discards[0]).Symbol; 68370var discard2 = model.GetSymbolInfo(discards[1]).Symbol; 68374var discard3 = model.GetSymbolInfo(discards[2]).Symbol; 68378var discard4 = model.GetSymbolInfo(discards[3]).Symbol; 68382var discard5 = model.GetSymbolInfo(discards[4]).Symbol; 68512Assert.Null(model.GetSymbolInfo(discard1).Symbol); 68513Assert.Null(model.GetSymbolInfo(discard1.Designation).Symbol); 68521Assert.Equal("object _", model.GetSymbolInfo(discard2).Symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat)); 68550Assert.Null(model.GetSymbolInfo(discardPattern1).Symbol); 68556Assert.Null(model.GetSymbolInfo(discardPattern2).Symbol); 141097Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141137Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141177Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141216Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141254Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141287Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141320Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141357Assert.Equal("Extension<object>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141396Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141666Assert.Equal("Extension<object?>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141697Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 141730Assert.Equal("Extension<object!>", model.GetSymbolInfo(invocation).Symbol.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 142182Assert.Null(info.Symbol); 152340Assert.Equal("void Program.F<T?>(System.Func<T?> f)", model.GetSymbolInfo(invocationNode).Symbol.ToTestDisplayString()); 152343Assert.Equal("void Program.F<T?>(System.Func<T?> f)", model.GetSymbolInfo(invocationNode2).Symbol.ToTestDisplayString()); 153175var field1 = model.GetSymbolInfo(declarators[0].Value).Symbol; 153177var field2 = model.GetSymbolInfo(declarators[1].Value).Symbol; 153179var field3 = model.GetSymbolInfo(declarators[2].Value).Symbol; 153225var method2 = model.GetSymbolInfo(invocations[0]).Symbol; 153228var method3 = model.GetSymbolInfo(invocations[1]).Symbol; 153655Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153691Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153786Assert.Equal("object", ((IMethodSymbol)model.GetSymbolInfo(item).Symbol).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153824Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 153976Assert.Equal("object", ((IPropertySymbol)model.GetSymbolInfo(item).Symbol).Type.ToDisplayString(TypeWithAnnotations.TestDisplayFormat)); 154071Assert.Equal("object", ((IMethodSymbol)model.GetSymbolInfo(item).Symbol).ReturnType.ToDisplayString(TypeWithAnnotations.TestDisplayFormat));
Semantics\ObjectAndCollectionInitializerTests.cs (14)
3460Assert.NotNull(symbolInfo.Symbol); 3461Assert.Equal("void X.Add(System.String x)", symbolInfo.Symbol.ToTestDisplayString()); 3467Assert.NotNull(symbolInfo.Symbol); 3468Assert.Equal("void X.Add(System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 3508Assert.Null(symbolInfo.Symbol); 3565Assert.Null(symbolInfo.Symbol); 3601Assert.NotNull(symbolInfo.Symbol); 3602Assert.Equal("void X.Add(System.String x, System.Int32 y)", symbolInfo.Symbol.ToTestDisplayString()); 3640Assert.Null(symbolInfo.Symbol); 3685Assert.Equal("void System.Collections.Generic.List<System.String>.Add(System.String item)", symbolInfo.Symbol.ToTestDisplayString()); 3735Assert.Equal("void System.Collections.Generic.List<System.String>.Add(System.String item)", symbolInfo.Symbol.ToTestDisplayString()); 3779Assert.Equal("void System.Collections.Generic.List<C>.Add(C item)", symbolInfo.Symbol.ToTestDisplayString()); 3853Assert.Null(symbolInfo.Symbol); 3933Assert.Equal("System.Collections.Generic.List<System.String>", semanticModel.GetSymbolInfo(name).Symbol.ToTestDisplayString());
Semantics\OperatorTests.cs (32)
58Assert.Equal("System.Int32 System.Int32.op_BitwiseOr(System.Int32 left, System.Int32 right)", insideEnumDefinition.Symbol.ToTestDisplayString()); 59Assert.Equal("TestEnum TestEnum.op_BitwiseOr(TestEnum left, TestEnum right)", insideMethodBody.Symbol.ToTestDisplayString()); 6941Assert.Equal(expectedOperator.GetPublicSymbol(), info.Symbol); 7542var symbol1 = (IMethodSymbol)info1.Symbol; 7543var symbol2 = semanticModel.GetSymbolInfo(node2).Symbol; 7544var symbol3 = (IMethodSymbol)semanticModel.GetSymbolInfo(node3).Symbol; 7545var symbol4 = semanticModel.GetSymbolInfo(node4).Symbol; 7671var otherSymbol = (IMethodSymbol)semanticModel.GetSymbolInfo(node1).Symbol; 7709var symbols1 = (from node1 in nodes select (IMethodSymbol)semanticModel.GetSymbolInfo(node1).Symbol).ToArray(); 7718var symbols2 = (from node2 in nodes select (IMethodSymbol)semanticModel.GetSymbolInfo(node2).Symbol).ToArray(); 8084if (info1.Symbol == null) 8112var symbol1 = (IMethodSymbol)info1.Symbol; 8113var symbol2 = semanticModel.GetSymbolInfo(node2).Symbol; 8114var symbol3 = semanticModel.GetSymbolInfo(node3).Symbol; 8115var symbol4 = semanticModel.GetSymbolInfo(node4).Symbol; 8116var symbol5 = (IMethodSymbol)semanticModel.GetSymbolInfo(node5).Symbol; 8117var symbol6 = semanticModel.GetSymbolInfo(node6).Symbol; 8118var symbol7 = semanticModel.GetSymbolInfo(node7).Symbol; 8119var symbol8 = semanticModel.GetSymbolInfo(node8).Symbol; 8467var otherSymbol = (IMethodSymbol)semanticModel.GetSymbolInfo(node1).Symbol; 8563Assert.Null(info1.Symbol); 8592var symbols1 = (from node1 in nodes select (IMethodSymbol)semanticModel.GetSymbolInfo(node1).Symbol).ToArray(); 8601var symbols2 = (from node2 in nodes select (IMethodSymbol)semanticModel.GetSymbolInfo(node2).Symbol).ToArray(); 8638var symbols1 = (from node1 in nodes select (IMethodSymbol)semanticModel.GetSymbolInfo(node1).Symbol).ToArray(); 8649var symbols2 = (from node2 in nodes select (IMethodSymbol)semanticModel.GetSymbolInfo(node2).Symbol).ToArray(); 8688var symbols1 = (from node1 in nodes select (IMethodSymbol)semanticModel.GetSymbolInfo(node1).Symbol).ToArray(); 8699var symbols2 = (from node2 in nodes select (IMethodSymbol)semanticModel.GetSymbolInfo(node2).Symbol).ToArray(); 8772Assert.Equal("System.Boolean System.Object.op_Equality(System.Object left, System.Object right)", info1.Symbol.ToTestDisplayString()); 8778Assert.Equal("System.Boolean System.Object.op_Inequality(System.Object left, System.Object right)", info1.Symbol.ToTestDisplayString()); 8781Assert.Equal("System.Boolean System.Int32.op_Equality(System.Int32 left, System.Int32 right)", info1.Symbol.ToTestDisplayString()); 8784Assert.Equal("System.Boolean System.Int32.op_Inequality(System.Int32 left, System.Int32 right)", info1.Symbol.ToTestDisplayString()); 8788Assert.Null(info1.Symbol);
Semantics\OutVarTests.cs (53)
991Assert.Same(symbol, model.GetSymbolInfo(reference).Symbol); 1011Assert.Equal(expectedSymbol, symbolInfo.Symbol); 1045Assert.Null(model.GetSymbolInfo(typeSyntax).Symbol); 1049Assert.Equal(expected, model.GetSymbolInfo(typeSyntax).Symbol); 1155Assert.Null(model.GetSymbolInfo(reference).Symbol); 1162var symbol = model.GetSymbolInfo(reference).Symbol; 1172var symbol = model.GetSymbolInfo(reference).Symbol; 18450Assert.Equal("Cls.Test2..ctor(System.Object x, System.Object y)", symbolInfo.Symbol.ToTestDisplayString()); 22648Assert.Null(model.GetSymbolInfo(decl.Type).Symbol); 22659Assert.Null(model.GetSymbolInfo(reference).Symbol); 32711Assert.Null(referenceInfo.Symbol); 32718Assert.Same(symbol, referenceInfo.Symbol); 32922Assert.Null(model.GetSymbolInfo(discard1).Symbol); 32926Assert.Null(model.GetSymbolInfo(declaration1).Symbol); 32931Assert.Null(model.GetSymbolInfo(discard2).Symbol); 32935Assert.Null(model.GetSymbolInfo(declaration2).Symbol); 32939var discard3Symbol = (IDiscardSymbol)model.GetSymbolInfo(discard3).Symbol; 33006Assert.Null(model.GetSymbolInfo(discard1).Symbol); 33010Assert.Null(model.GetSymbolInfo(declaration1).Symbol); 33013Assert.Equal("System.Int32", model.GetSymbolInfo(declaration1.Type).Symbol.ToTestDisplayString()); 33022Assert.Null(model.GetSymbolInfo(discard2).Symbol); 33026Assert.Null(model.GetSymbolInfo(declaration2).Symbol); 33029Assert.Equal("System.Int32", model.GetSymbolInfo(declaration2.Type).Symbol.ToTestDisplayString()); 33038var discard3Symbol = (IDiscardSymbol)model.GetSymbolInfo(discard3).Symbol; 33078Assert.Null(model.GetSymbolInfo(discard1).Symbol); 33082Assert.Null(model.GetSymbolInfo(declaration1).Symbol); 33085Assert.Equal("System.Int64", model.GetSymbolInfo(declaration1.Type).Symbol.ToTestDisplayString()); 33120Assert.Null(model.GetSymbolInfo(discard1).Symbol); 33124Assert.Null(model.GetSymbolInfo(declaration1).Symbol); 33127Assert.Equal("System.Int32", model.GetSymbolInfo(declaration1.Type).Symbol.ToTestDisplayString()); 33136Assert.Null(model.GetSymbolInfo(discard2).Symbol); 33140Assert.Null(model.GetSymbolInfo(declaration2).Symbol); 33143Assert.Equal("System.Int32", model.GetSymbolInfo(declaration2.Type).Symbol.ToTestDisplayString()); 33184Assert.Null(model.GetSymbolInfo(discard1).Symbol); 33188Assert.Null(model.GetSymbolInfo(declaration1).Symbol); 33191Assert.Equal("alias1", model.GetSymbolInfo(declaration1.Type).Symbol.ToTestDisplayString()); 33200Assert.Null(model.GetSymbolInfo(discard2).Symbol); 33205Assert.Null(model.GetSymbolInfo(declaration2).Symbol); 33208Assert.Equal("var", model.GetSymbolInfo(declaration2.Type).Symbol.ToTestDisplayString()); 33449Assert.Equal("System.String x", model.GetSymbolInfo(x).Symbol.ToTestDisplayString()); 35612Assert.Equal("void C.G(out System.Object o)", info.Symbol.ToTestDisplayString()); 36310Assert.Equal("System.String C.M2(out System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 36314Assert.Equal("System.String C.M2(out System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 36357Assert.Equal("System.String M2(out System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 36358Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single())); 36397Assert.Equal("System.String C.M2(out System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 36402Assert.Equal("System.String C.M2(out System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 36439Assert.Equal("System.String M2(out System.Int32 x, [System.String y = null])", symbolInfo.Symbol.ToTestDisplayString()); 36440Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single())); 36474Assert.Equal("System.String C.M2(out System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 36480Assert.Equal("System.String C.M2(out System.Int32 x)", symbolInfo.Symbol.ToTestDisplayString()); 36512Assert.Equal("System.String M2(out System.Int32 x, [System.String y = null])", symbolInfo.Symbol.ToTestDisplayString()); 36513Assert.Same(symbolInfo.Symbol, speculativeModel.GetDeclaredSymbol(tree2.GetRoot().DescendantNodes().OfType<LocalFunctionStatementSyntax>().Where(l => l.Identifier.ValueText == "M2").Single()));
Semantics\OverloadResolutionTests.cs (7)
7154model.GetSymbolInfo(callSyntax).Symbol.ToTestDisplayString()); 7262var methodSymbol = (IMethodSymbol)model.GetSymbolInfo(callSyntax).Symbol; 7436var symbol = model.GetSymbolInfo(syntax).Symbol; 7477var symbol = model.GetSymbolInfo(syntax).Symbol; 11338var symbol = model.GetSymbolInfo(expr).Symbol.GetSymbol<MethodSymbol>(); 11387var symbol = model.GetSymbolInfo(expr).Symbol.GetSymbol<PropertySymbol>(); 11437var symbol = model.GetSymbolInfo(expr).Symbol.GetSymbol<EventSymbol>();
Semantics\PrimaryConstructorTests.cs (60)
901var symbol = model.GetSymbolInfo(x).Symbol; 967var symbol = model.GetSymbolInfo(x).Symbol; 981Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 982Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo(baseWithargs).Symbol.ToTestDisplayString()); 983Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", CSharpExtensions.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString()); 989Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 991Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo(baseWithargs).Symbol.ToTestDisplayString()); 993Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", CSharpExtensions.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString()); 1088Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 1089Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", model.GetSymbolInfo(baseWithargs).Symbol.ToTestDisplayString()); 1090Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", CSharpExtensions.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString()); 1195var symbol = model.GetSymbolInfo(x).Symbol; 1208symbol = model.GetSymbolInfo(y).Symbol; 1219symbol = model.GetSymbolInfo(test).Symbol; 1261Assert.Null(symbolInfo.Symbol); 1307Assert.Null(symbolInfo.Symbol); 1367Assert.Null(symbolInfo.Symbol); 1424var symbol = model.GetSymbolInfo(x).Symbol; 1436Assert.Null(symbolInfo.Symbol); 1513var symbol = model.GetSymbolInfo(x).Symbol; 1525Assert.Null(symbolInfo.Symbol); 1710Assert.Null(symbolInfo.Symbol); 1750Assert.Null(symbolInfo.Symbol); 1793Assert.Equal("System.Int32 X", symbolInfo.Symbol.ToTestDisplayString()); 1862var symbol = model.GetSymbolInfo(x).Symbol; 2015Assert.Null(symbolInfo.Symbol); 2020Assert.Null(symbolInfo.Symbol); 2024Assert.Null(symbolInfo.Symbol); 2033Assert.Null(symbolInfo.Symbol); 2038Assert.Null(symbolInfo.Symbol); 2043Assert.Null(symbolInfo.Symbol); 2072Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel.GetSymbolInfo((SyntaxNode)speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 2073Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel.GetSymbolInfo(speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 2074Assert.Equal("Base..ctor(System.Int32 X)", CSharpExtensions.GetSymbolInfo(speculativeModel, speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 2083Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel.GetSymbolInfo((SyntaxNode)speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 2084Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel.GetSymbolInfo(speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 2085Assert.Equal("Base..ctor(System.Int32 X)", CSharpExtensions.GetSymbolInfo(speculativeModel, speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 2097Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 2100Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 2103Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 2106Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 2116Assert.Null(symbolInfo.Symbol); 2121Assert.Null(symbolInfo.Symbol); 2125Assert.Null(symbolInfo.Symbol); 2139Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 2142Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 2255Assert.Null(symbolInfo.Symbol); 2260Assert.Null(symbolInfo.Symbol); 2264Assert.Null(symbolInfo.Symbol); 2278Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 2281Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 2321Assert.Null(symbolInfo.Symbol); 2536var symbol = model.GetSymbolInfo(x).Symbol; 2574var symbol = model.GetSymbolInfo(x).Symbol; 2611var symbol = model.GetSymbolInfo(x).Symbol; 2647var symbol = model.GetSymbolInfo(x).Symbol; 6219AssertEx.Equal("System.Int32 X", model.GetSymbolInfo(xReference).Symbol.ToTestDisplayString()); 7182var symbol = symbolInfo.Symbol; 7751var symbol = model.GetSymbolInfo(p1).Symbol; 8157var symbol = model.GetSymbolInfo(p1).Symbol;
Semantics\QueryTests.cs (39)
1461Assert.Equal("Cast", info0.CastInfo.Symbol.Name); 1462Assert.NotEqual(MethodKind.ReducedExtension, ((IMethodSymbol)info0.CastInfo.Symbol).MethodKind); 1463Assert.Null(info0.OperationInfo.Symbol); 1469Assert.Equal("Cast", info1.CastInfo.Symbol.Name); 1470Assert.Equal("SelectMany", info1.OperationInfo.Symbol.Name); 1471Assert.NotEqual(MethodKind.ReducedExtension, ((IMethodSymbol)info1.OperationInfo.Symbol).MethodKind); 1477Assert.Equal("Cast", info2.CastInfo.Symbol.Name); 1478Assert.Equal("SelectMany", info2.OperationInfo.Symbol.Name); 1670Assert.Equal("Cast", info0.CastInfo.Symbol.Name); 1671Assert.Equal(MethodKind.ReducedExtension, ((IMethodSymbol)info0.CastInfo.Symbol).MethodKind); 1672Assert.Null(info0.OperationInfo.Symbol); 1678Assert.Equal("Cast", info1.CastInfo.Symbol.Name); 1679Assert.Equal("SelectMany", info1.OperationInfo.Symbol.Name); 1680Assert.Equal(MethodKind.ReducedExtension, ((IMethodSymbol)info1.OperationInfo.Symbol).MethodKind); 1686Assert.Equal("Cast", info2.CastInfo.Symbol.Name); 1687Assert.Equal("SelectMany", info2.OperationInfo.Symbol.Name); 1727Assert.Equal("Cast", info0.CastInfo.Symbol.Name); 1728Assert.Null(info0.OperationInfo.Symbol); 1732Assert.Equal("Cast", info1.CastInfo.Symbol.Name); 1733Assert.Equal("SelectMany", info1.OperationInfo.Symbol.Name); 1765Assert.Null(info0.CastInfo.Symbol); 1766Assert.Null(info0.OperationInfo.Symbol); 1771Assert.Null(info1.CastInfo.Symbol); 1772Assert.Null(info1.OperationInfo.Symbol); 2392Assert.Null(queryInfoForFrom1.CastInfo.Symbol); 2393Assert.Null(queryInfoForFrom1.OperationInfo.Symbol); 2395Assert.Null(queryInfoForFrom2.CastInfo.Symbol); 2396Assert.Equal("SelectMany", queryInfoForFrom2.OperationInfo.Symbol.Name); 2904Assert.Null(info0.CastInfo.Symbol); 2905Assert.Null(info0.OperationInfo.Symbol); 2937Assert.Null(info0.CastInfo.Symbol); 2938Assert.Null(info0.OperationInfo.Symbol); 3139Assert.Null(symbolInfo.Symbol); // there is no select method to call because the receiver is bad 3429Assert.Equal("Cast", info0.CastInfo.Symbol.Name); 3430Assert.Null(info0.OperationInfo.Symbol); 3434Assert.Equal("Cast", info1.CastInfo.Symbol.Name); 3435Assert.Equal("SelectMany", info1.OperationInfo.Symbol.Name); 3480Assert.NotNull(selectClauseSymbolInfo.Symbol); 3481Assert.Equal("Select", selectClauseSymbolInfo.Symbol.Name);
Semantics\ReadOnlyStructsTests.cs (1)
1283var symbol = (IMethodSymbol)semanticModel.GetSymbolInfo(invocationExpression.Expression).Symbol;
Semantics\RecordStructTests.cs (10)
2308Assert.Equal("System.Boolean System.ValueType.X { get; set; }", model.GetSymbolInfo(x!).Symbol.ToTestDisplayString()); 2332Assert.Equal("System.Boolean System.ValueType.X { get; set; }", model.GetSymbolInfo(x!).Symbol.ToTestDisplayString()); 2597var symbol = model.GetSymbolInfo(x).Symbol; 2632var symbol = model.GetSymbolInfo(x).Symbol; 2666var symbol = model.GetSymbolInfo(x).Symbol; 2701var symbol = model.GetSymbolInfo(x).Symbol; 3259Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); 3307Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); 3358Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); 5826var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!;
Semantics\RecordTests.cs (61)
284model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); 455var initializer = model.GetSymbolInfo(initializerSyntax.Value).Symbol!; 2496var symbol = model.GetSymbolInfo(x).Symbol; 8617Assert.True(x.ISymbol.Equals(symbolInfo.Symbol)); 21158var symbol = model.GetSymbolInfo(x).Symbol; 21172Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 21173Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo(baseWithargs).Symbol.ToTestDisplayString()); 21174Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", CSharpExtensions.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString()); 21180Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 21182Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo(baseWithargs).Symbol.ToTestDisplayString()); 21184Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", CSharpExtensions.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString()); 21281Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 21282Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", model.GetSymbolInfo(baseWithargs).Symbol.ToTestDisplayString()); 21283Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", CSharpExtensions.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString()); 21388var symbol = model.GetSymbolInfo(x).Symbol; 21401symbol = model.GetSymbolInfo(y).Symbol; 21412symbol = model.GetSymbolInfo(test).Symbol; 21454Assert.Null(symbolInfo.Symbol); 21500Assert.Null(symbolInfo.Symbol); 21560Assert.Null(symbolInfo.Symbol); 21617var symbol = model.GetSymbolInfo(x).Symbol; 21629Assert.Null(symbolInfo.Symbol); 21706var symbol = model.GetSymbolInfo(x).Symbol; 21718Assert.Null(symbolInfo.Symbol); 21903Assert.Null(symbolInfo.Symbol); 21940Assert.Null(symbolInfo.Symbol); 21980Assert.Equal("System.Int32 X", symbolInfo.Symbol.ToTestDisplayString()); 22015Assert.Null(symbolInfo.Symbol); 22093var symbol = model.GetSymbolInfo(x).Symbol; 22246Assert.Null(symbolInfo.Symbol); 22251Assert.Null(symbolInfo.Symbol); 22255Assert.Null(symbolInfo.Symbol); 22264Assert.Null(symbolInfo.Symbol); 22269Assert.Null(symbolInfo.Symbol); 22274Assert.Null(symbolInfo.Symbol); 22303Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel!.GetSymbolInfo((SyntaxNode)speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 22304Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel.GetSymbolInfo(speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 22305Assert.Equal("Base..ctor(System.Int32 X)", CSharpExtensions.GetSymbolInfo(speculativeModel, speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 22314Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel!.GetSymbolInfo((SyntaxNode)speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 22315Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel.GetSymbolInfo(speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 22316Assert.Equal("Base..ctor(System.Int32 X)", CSharpExtensions.GetSymbolInfo(speculativeModel, speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 22328Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 22331Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 22334Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 22337Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 22347Assert.Null(symbolInfo.Symbol); 22352Assert.Null(symbolInfo.Symbol); 22356Assert.Null(symbolInfo.Symbol); 22370Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 22373Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 22486Assert.Null(symbolInfo.Symbol); 22491Assert.Null(symbolInfo.Symbol); 22495Assert.Null(symbolInfo.Symbol); 22509Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 22512Assert.Equal("Base..ctor(System.Int32 X)", symbolInfo.Symbol.ToTestDisplayString()); 24657var symbol = model.GetSymbolInfo(x).Symbol; 24692var symbol = model.GetSymbolInfo(x).Symbol; 24726var symbol = model.GetSymbolInfo(x).Symbol; 24761var symbol = model.GetSymbolInfo(x).Symbol; 28327Assert.Equal(SymbolKind.Property, model.GetSymbolInfo(cref).Symbol!.Kind); 30352AssertEx.Equal("System.Int32 X", model.GetSymbolInfo(xReference).Symbol.ToTestDisplayString());
Semantics\RefFieldTests.cs (88)
10679var lambda = model.GetSymbolInfo(value).Symbol.GetSymbol<LambdaSymbol>(); 10940var lambdas = tree.GetRoot().DescendantNodes().OfType<SimpleLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray(); 11489var method = model.GetSymbolInfo(expr).Symbol.GetSymbol<RetargetingMethodSymbol>(); 11586Assert.Null(model.GetSymbolInfo(type).Symbol); 11593Assert.Null(model.GetSymbolInfo(type).Symbol); 11599Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 11650Assert.Null(model.GetSymbolInfo(type).Symbol); 11657Assert.Null(model.GetSymbolInfo(type).Symbol); 11663Assert.Equal("Script.R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 11720Assert.Null(model.GetSymbolInfo(type).Symbol); 11727Assert.Null(model.GetSymbolInfo(type).Symbol); 11733Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 11909Assert.Null(model.GetSymbolInfo(type).Symbol); 11916Assert.Null(model.GetSymbolInfo(type).Symbol); 11922Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 11932Assert.Null(model.GetSymbolInfo(decl).Symbol); 11941Assert.Null(model.GetSymbolInfo(type).Symbol); 11948Assert.Null(model.GetSymbolInfo(type).Symbol); 11954Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 12089Assert.Null(model.GetSymbolInfo(type).Symbol); 12096Assert.Null(model.GetSymbolInfo(type).Symbol); 12102Assert.Equal("Script.R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 12112Assert.Null(model.GetSymbolInfo(decl).Symbol); 12117Assert.Null(model.GetSymbolInfo(type).Symbol); 12124Assert.Null(model.GetSymbolInfo(type).Symbol); 12130Assert.Equal("Script.R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 12320Assert.Null(model.GetSymbolInfo(type).Symbol); 12327Assert.Null(model.GetSymbolInfo(type).Symbol); 12333Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 12345Assert.Null(model.GetSymbolInfo(decl).Symbol); 12354Assert.Null(model.GetSymbolInfo(type).Symbol); 12361Assert.Null(model.GetSymbolInfo(type).Symbol); 12367Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 12496Assert.Null(model.GetSymbolInfo(type).Symbol); 12503Assert.Null(model.GetSymbolInfo(type).Symbol); 12509Assert.Equal("Script.R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 12519Assert.Null(model.GetSymbolInfo(decl).Symbol); 12524Assert.Null(model.GetSymbolInfo(type).Symbol); 12531Assert.Null(model.GetSymbolInfo(type).Symbol); 12537Assert.Equal("Script.R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 12962Assert.Null(model.GetSymbolInfo(type).Symbol); 12969Assert.Null(model.GetSymbolInfo(type).Symbol); 12975Assert.Equal("R<System.Int32>", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 13026Assert.Null(model.GetSymbolInfo(type).Symbol); 13033Assert.Null(model.GetSymbolInfo(type).Symbol); 13039Assert.Equal("R<System.Int32>", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 13103Assert.Null(model.GetSymbolInfo(type).Symbol); 13110Assert.Null(model.GetSymbolInfo(type).Symbol); 13116Assert.Equal("R<System.Int32>", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 13173Assert.Null(model.GetSymbolInfo(type).Symbol); 13180Assert.Null(model.GetSymbolInfo(type).Symbol); 13186Assert.Equal("R<System.Int32>", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 13870Assert.Equal("R", model.GetSymbolInfo(type.SkipScoped(out _).SkipRef()).Symbol.ToTestDisplayString()); 13912Assert.Equal("R", model.GetSymbolInfo(type.SkipScoped(out _).SkipRef()).Symbol.ToTestDisplayString()); 14120Assert.Null(model.GetSymbolInfo(type).Symbol); 14127Assert.Null(model.GetSymbolInfo(type).Symbol); 14133Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 14364Assert.Null(model.GetSymbolInfo(type).Symbol); 14371Assert.Null(model.GetSymbolInfo(type).Symbol); 14377Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 14387Assert.Null(model.GetSymbolInfo(decl).Symbol); 14392Assert.Null(model.GetSymbolInfo(type).Symbol); 14399Assert.Null(model.GetSymbolInfo(type).Symbol); 14405Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 14655Assert.Null(model.GetSymbolInfo(type).Symbol); 14662Assert.Null(model.GetSymbolInfo(type).Symbol); 14668Assert.Equal("R<System.Int32>", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 16060Assert.Null(model.GetSymbolInfo(invocations[0]).Symbol); 16063Assert.Null(model.GetSymbolInfo(invocations[1]).Symbol); 16101var method = model.GetSymbolInfo(anonymousMethod).Symbol; 16141var method = model.GetSymbolInfo(anonymousMethod).Symbol; 16287var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 23361var lambdas = tree.GetRoot().DescendantNodes().OfType<ParenthesizedLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray(); 23397var lambdas = tree.GetRoot().DescendantNodes().OfType<ParenthesizedLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray(); 23434var lambdas = tree.GetRoot().DescendantNodes().OfType<ParenthesizedLambdaExpressionSyntax>().Select(e => model.GetSymbolInfo(e).Symbol.GetSymbol<LambdaSymbol>()).ToArray(); 24222var lambda = model.GetSymbolInfo(value).Symbol.GetSymbol<LambdaSymbol>(); 26307Assert.Null(model.GetSymbolInfo(type).Symbol); 26314Assert.Null(model.GetSymbolInfo(type).Symbol); 26320Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 26397Assert.Null(model.GetSymbolInfo(type).Symbol); 26404Assert.Null(model.GetSymbolInfo(type).Symbol); 26410Assert.Equal("R", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 26664Assert.Null(model.GetSymbolInfo(type).Symbol); 26669Assert.Equal("R<System.Int32>", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 26724Assert.Null(model.GetSymbolInfo(type).Symbol); 26729Assert.Equal("R<System.Int32>", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()); 26946Assert.Equal("R", model.GetSymbolInfo(type.SkipScoped(out _).SkipRef()).Symbol.ToTestDisplayString()); 26994Assert.Equal("R", model.GetSymbolInfo(type.SkipScoped(out _).SkipRef()).Symbol.ToTestDisplayString());
Semantics\RefLocalsAndReturnsTests.cs (2)
4823Assert.Null(model.GetSymbolInfo(type).Symbol); 4829Assert.Equal("System.Int32", model.GetSymbolInfo(type).Symbol.ToTestDisplayString());
Semantics\ScriptSemanticsTests.cs (22)
499Assert.NotNull(info.Symbol); 500Assert.Equal("void System.Console.WriteLine(System.String value)", info.Symbol.ToTestDisplayString()); 525var symbol1 = model.GetSymbolInfo(((GotoStatementSyntax)statements[1]).Expression).Symbol; 541var symbol1 = model.GetSymbolInfo(declarations[1].Initializer.Value).Symbol; 1185Assert.Null(semanticModel.GetSymbolInfo(node5.Name).Symbol); 1197Assert.Null(semanticModel.GetSymbolInfo(node5.Name).Symbol); 1212Assert.Equal("void System.Console.WriteLine(System.Int32 value)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()); 1221Assert.Equal("void System.Console.WriteLine(System.Int32 value)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()); 1230Assert.Equal("void System.Console.WriteLine(System.Int32 value)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()); 1242Assert.Equal("void System.Console.WriteLine(System.Int32 value)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()); 1254Assert.Equal("void System.Console.WriteLine(System.Int32 value)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()); 1278Assert.Null(semanticModel1.GetSymbolInfo(node1.Name).Symbol); 1279Assert.Equal("void System.Console.WriteLine(System.Int32 value)", semanticModel2.GetSymbolInfo(node2.Name).Symbol.ToTestDisplayString()); 1290Assert.Null(semanticModel1.GetSymbolInfo(node1.Name).Symbol); 1291Assert.Equal("void System.Console.WriteLine(System.Int32 value)", semanticModel2.GetSymbolInfo(node2.Name).Symbol.ToTestDisplayString()); 1312Assert.Null(semanticModel.GetSymbolInfo(node5.Name).Symbol); 1314Assert.Null(semanticModel.GetSymbolInfo(x).Symbol); 1326Assert.Null(semanticModel.GetSymbolInfo(node5.Name).Symbol); 1341Assert.Null(semanticModel.GetSymbolInfo(node5.Name).Symbol); 1343Assert.Equal("var Script.x", semanticModel.GetSymbolInfo(x).Symbol.ToTestDisplayString()); 1356Assert.Null(semanticModel.GetSymbolInfo(node5.Name).Symbol); 1358Assert.Equal("var Script1.x", semanticModel.GetSymbolInfo(x).Symbol.ToTestDisplayString());
Semantics\SemanticErrorTests.cs (1)
3338Assert.Null(boundCall.Symbol);
Semantics\SuppressAccessibilityChecksTests.cs (7)
58Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name); 63Assert.Null(semanticModel.GetSymbolInfo(invocation).Symbol); 80semanticModel.GetSpeculativeSymbolInfo(position, exp, SpeculativeBindingOption.BindAsExpression).Symbol.Name); 129Assert.Equal("_p", symbolInfo.Symbol.Name); 172Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name); 178Assert.Equal("InternalExtension", semanticModel.GetSpeculativeSymbolInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Symbol.Name); 236Assert.Equal("_p", symbolSpeculation.Symbol.Name);
Semantics\TargetTypedDefaultTests.cs (24)
47Assert.Null(model.GetSymbolInfo(def).Symbol); 147Assert.Null(model.GetSymbolInfo(def).Symbol); 248Assert.Null(model.GetSymbolInfo(def).Symbol); 257Assert.Null(model.GetSymbolInfo(nullSyntax).Symbol); 285Assert.Null(model.GetSymbolInfo(def).Symbol); 294Assert.Null(model.GetSymbolInfo(nullSyntax).Symbol); 524Assert.Null(model.GetSymbolInfo(def).Symbol); 570Assert.Null(model.GetSymbolInfo(def).Symbol); 613Assert.Null(model.GetSymbolInfo(def).Symbol); 671Assert.Null(model.GetSymbolInfo(def).Symbol); 752Assert.Null(model.GetSymbolInfo(def).Symbol); 840Assert.Null(model.GetSymbolInfo(def).Symbol); 869Assert.Null(model.GetSymbolInfo(def).Symbol); 1146Assert.Null(model.GetSymbolInfo(def).Symbol); 1258Assert.Null(model.GetSymbolInfo(addition).Symbol); 2337Assert.Null(model.GetSymbolInfo(def).Symbol); 2461Assert.Null(model.GetSymbolInfo(def).Symbol); 3058Assert.Null(model.GetSymbolInfo(def).Symbol); 3517Assert.Null(model.GetSymbolInfo(def).Symbol); 3520Assert.Null(model.GetSymbolInfo(def).Symbol); 3578Assert.Null(model.GetSymbolInfo(default1).Symbol); 3586Assert.Null(model.GetSymbolInfo(default2).Symbol); 3593Assert.Null(model.GetSymbolInfo(default3).Symbol); 3600Assert.Null(model.GetSymbolInfo(default4).Symbol);
Semantics\TopLevelStatementsTests.cs (78)
195var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 250Assert.Null(symbolInfo.Symbol); 261Assert.Null(symbolInfo.Symbol); 320var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 401Assert.Null(symbolInfo.Symbol); 412Assert.Null(symbolInfo.Symbol); 501var refSymbol = model2.GetSymbolInfo(localRef).Symbol; 545var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 592var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 702Assert.Same(local, model.GetSymbolInfo(reference).Symbol); 873Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single()).Symbol); 879Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Single()).Symbol); 987Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").First()).Symbol); 991Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "x").Skip(1).Single()).Symbol); 1042Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single()).Symbol); 1396var symbol2 = model2.GetSymbolInfo(nameRef).Symbol; 1414symbol2 = model2.GetSymbolInfo(nameRef).Symbol; 1698Assert.Same(declSymbol, model1.GetSymbolInfo(nameRef).Symbol); 1707Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 1722Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 1728Assert.Same(declSymbol, model.GetSymbolInfo(nameRef).Symbol); 1733Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 1738Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 1744Assert.Same(declSymbol, model.GetSymbolInfo(nameRef).Symbol); 1875Assert.Same(testType, model2.GetSymbolInfo(nameRef).Symbol); 1890Assert.Same(testType, model2.GetSymbolInfo(nameRef).Symbol); 1896Assert.Same(declSymbol, model2.GetSymbolInfo(nameRef).Symbol); 1901Assert.Same(testType, model2.GetSymbolInfo(nameRef).Symbol); 1906Assert.Same(testType, model2.GetSymbolInfo(nameRef).Symbol); 1912Assert.Same(declSymbol, model2.GetSymbolInfo(nameRef).Symbol); 2093Assert.Same(testType, model1.GetSymbolInfo(nameRef).Symbol); 2105Assert.Same(testType, model1.GetSymbolInfo(nameRef).Symbol); 2110Assert.Same(declSymbol, model1.GetSymbolInfo(nameRef).Symbol); 2115Assert.Same(testType, model1.GetSymbolInfo(nameRef).Symbol); 2120Assert.Same(testType, model1.GetSymbolInfo(nameRef).Symbol); 2125Assert.Same(declSymbol, model1.GetSymbolInfo(nameRef).Symbol); 2259Assert.Same(testType, model2.GetSymbolInfo(nameRef).Symbol); 2271Assert.Same(testType, model2.GetSymbolInfo(nameRef).Symbol); 2276Assert.Same(declSymbol, model2.GetSymbolInfo(nameRef).Symbol); 2281Assert.Same(testType, model2.GetSymbolInfo(nameRef).Symbol); 2286Assert.Same(testType, model2.GetSymbolInfo(nameRef).Symbol); 2291Assert.Same(declSymbol, model2.GetSymbolInfo(nameRef).Symbol); 2439Assert.Same(testType, model1.GetSymbolInfo(nameRef).Symbol); 2453Assert.Same(declSymbol, model1.GetSymbolInfo(nameRef).Symbol); 2468Assert.Same(testType, model1.GetSymbolInfo(nameRef).Symbol); 2473Assert.Null(model1.GetSymbolInfo(nameRef).Symbol); 2478Assert.Same(testType, model1.GetSymbolInfo(nameRef).Symbol); 2483Assert.Same(testType, model1.GetSymbolInfo(nameRef).Symbol); 2487Assert.Null(model1.GetSymbolInfo(nameRef).Symbol); 3934Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 3945var parameter = model.GetSymbolInfo(nameRef).Symbol; 3964Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 3969Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 3974Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 3979Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 3984Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 4083Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 4094Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 4099Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 4104Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 4109Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 4114Assert.Same(testType, model.GetSymbolInfo(nameRef).Symbol); 4207Assert.Same(local, model.GetSymbolInfo(reference).Symbol); 4500Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Single()).Symbol); 4506Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Single()).Symbol); 4564Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").First()).Symbol); 4568Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "local1").Skip(1).Single()).Symbol); 4613Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "args").Single()).Symbol); 4885Assert.Same(label, model.GetSymbolInfo(reference).Symbol); 4940Assert.Same(symbol1, model1.GetSymbolInfo(tree1.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single()).Symbol); 4947Assert.Same(symbol2, model2.GetSymbolInfo(tree2.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "label1").Single()).Symbol); 4970Assert.Same(label, model.GetSymbolInfo(reference).Symbol); 6027var refSymbol = model1.GetSymbolInfo(localRef).Symbol; 6225Assert.Null(semanticModel.GetSymbolInfo(invocation).Symbol); 6233Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name); 6271Assert.Same(x, semanticModel.GetSymbolInfo(localRef).Symbol); 6316var xRef = semanticModel1.GetSymbolInfo(localRef).Symbol; 6371var xRef = semanticModel2.GetSymbolInfo(localRef).Symbol;
Semantics\TryCatchTests.cs (1)
50Assert.Equal("string.operator !=(string, string)", filterExprInfo.Symbol.ToDisplayString());
Semantics\TypeOfTests.cs (1)
37Assert.Equal("C..ctor(System.Int32 i)", symbolInfo.Symbol.ToTestDisplayString());
Semantics\UnsafeTests.cs (6)
4423Assert.Null(symbolInfo.Symbol); 4490Assert.Null(symbolInfo.Symbol); 4528Assert.Null(symbolInfo.Symbol); 4570Assert.Null(symbolInfo.Symbol); 4701Assert.Null(symbolInfo.Symbol); 7422Assert.Equal(declaredSymbols[i], info.Symbol);
Semantics\UsingStatementTests.cs (4)
73Assert.Equal(declaredLocal, info.Symbol); 1347Assert.Equal(((ILocalSymbol)declaredSymbol).Type, typeInfo.Symbol); 1388Assert.Equal(((ILocalSymbol)model.GetDeclaredSymbol(usingStatement.Declaration.Variables.First())).Type, typeInfo.Symbol); 1884Assert.Equal(symbol, type.Symbol);
Semantics\Utf8StringsLiteralsTests.cs (14)
2972Assert.Null(symbolInfo.Symbol); 3000Assert.Null(symbolInfo.Symbol); 3028Assert.Null(symbolInfo.Symbol); 3056Assert.Null(symbolInfo.Symbol); 3084Assert.Null(symbolInfo.Symbol); 3112Assert.Null(symbolInfo.Symbol); 3140Assert.Null(symbolInfo.Symbol); 3168Assert.Null(symbolInfo.Symbol); 3196Assert.Null(symbolInfo.Symbol); 3224Assert.Null(symbolInfo.Symbol); 3252Assert.Null(symbolInfo.Symbol); 3280Assert.Equal("System.ReadOnlySpan<System.Char> System.String.op_Implicit(System.String? value)", symbolInfo.Symbol.ToTestDisplayString()); 3308Assert.Equal("System.ReadOnlySpan<System.Char> System.String.op_Implicit(System.String? value)", symbolInfo.Symbol.ToTestDisplayString()); 4065var method = (IMethodSymbol)model.GetSymbolInfo(node).Symbol;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (633)
Compilation\CompilationAPITests.cs (3)
2844var symbol = semanticModel.GetSymbolInfo(expr).Symbol; 2879var symbol = semanticModel.GetSymbolInfo(expr).Symbol; 2911var symbol = semanticModel.GetSymbolInfo(expr).Symbol;
Compilation\GetSemanticInfoTests.cs (69)
45Assert.Equal(SymbolKind.Parameter, sym.Symbol.Kind); 46Assert.Equal("x", sym.Symbol.Name); 75Assert.Equal(SymbolKind.Method, sym.Symbol.Kind); 104Assert.NotNull(sym.Symbol); 105Assert.Equal(SymbolKind.Method, sym.Symbol.Kind); 138Assert.NotNull(sym.Symbol); 139Assert.Equal(SymbolKind.Method, sym.Symbol.Kind); 167Assert.Null(sym.Symbol); 1072var baseConstructor = bindInfo.Symbol; 1091var baseConstructor = bindInfo.Symbol; 1115var invokedConstructor = (IMethodSymbol)bindInfo.Symbol; 1848var method = (IMethodSymbol)bindInfo.Symbol; 1890var type = (INamedTypeSymbol)bindInfo.Symbol; 1918var arrayType = (IArrayTypeSymbol)bindInfo.Symbol; 1953Assert.Equal("System.Collections.Generic.IEnumerable<System.Object> System.Collections.Generic.IEnumerable<T>.Select<T, System.Object>(System.Func<T, System.Object> selector)", bindInfo.Symbol.ToTestDisplayString()); 1989Assert.Equal("System.Collections.Generic.IEnumerable<System.Int32> System.Collections.Generic.IEnumerable<T>.Select<T, System.Int32>(System.Func<T, System.Int32> selector)", bindInfo.Symbol.ToTestDisplayString()); 2025Assert.Equal("System.Collections.Generic.IEnumerable<System.Int32> System.Collections.Generic.IEnumerable<T>.Select<T, System.Int32>(System.Func<T, System.Int32> selector)", bindInfo.Symbol.ToTestDisplayString()); 2060Assert.Equal("System.Collections.Generic.IEnumerable<System.Object> System.Collections.Generic.IEnumerable<T>.Select<T, System.Object>(System.Func<T, System.Object> selector)", bindInfo.Symbol.ToTestDisplayString()); 2329Assert.Equal("System.IO.StreamWriter", typeInfo.Symbol.ToTestDisplayString()); 2397Assert.NotNull(symbolInfo.Symbol); 2402Assert.Equal("A", symbolInfo.Symbol.Name); 2409Assert.Equal("B", symbolInfo.Symbol.Name); 2413Assert.Equal("D", symbolInfo.Symbol.Name); 2419Assert.Equal("B", symbolInfo.Symbol.Name); 2425Assert.Equal("B", symbolInfo.Symbol.Name); 2453Assert.Equal("System.Double System.Double.op_Addition(System.Double left, System.Double right)", sym.Symbol.ToTestDisplayString()); 2482Assert.Equal("System.Int32 System.Int32.op_CheckedAddition(System.Int32 left, System.Int32 right)", sym.Symbol.ToTestDisplayString()); 2539var symbol = info.Symbol; 2726var symbol = symbolInfo.Symbol; 2797Assert.Equal(operatorSymbol, symbolInfo.Symbol); 2799var method = (IMethodSymbol)symbolInfo.Symbol; 2843Assert.Null(symbolInfo.Symbol); 2874Assert.Null(symbolInfo.Symbol); 2934Assert.Null(symbolInfo.Symbol); 2967Assert.Null(symbolInfo.Symbol); 3026Assert.Null(symbolInfo.Symbol); 3059Assert.Null(symbolInfo.Symbol); 3100Assert.Null(symbolInfo.Symbol); 3133Assert.Equal("System.String System.String.op_Addition(System.Object left, System.String right)", symbolInfo.Symbol.ToTestDisplayString()); 3174Assert.Null(symbolInfo.Symbol); 3207Assert.Equal("System.String System.String.op_Addition(System.Object left, System.String right)", symbolInfo.Symbol.ToTestDisplayString()); 3250Assert.Equal(operatorSymbol, symbolInfo.Symbol); 3470Assert.Equal("void Test.M(A a)", symbolInfo.Symbol.ToTestDisplayString()); 3524Assert.Equal("void C.M<B<A>>(B<A> t)", symbolInfo.Symbol.ToTestDisplayString()); 3584Assert.Equal("C.MessageBox(System.IntPtr, string, string, uint)", symbolInfo.Symbol.ToDisplayString()); 3760Assert.Equal("System.Void", symbolInfo.Symbol.ToString()); 3823Assert.Null(info.Symbol); 3876Assert.Null(info.Symbol); 3917Assert.Equal(compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("IA").GetMember<IPropertySymbol>("P"), info.Symbol); 3957Assert.Null(info.Symbol); 4002Assert.Null(info.Symbol); 4042var method1 = info1.Symbol as IMethodSymbol; 4070var method2 = info2.Symbol as IMethodSymbol; 4116Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info0.Symbol.OriginalDefinition).SpecialType); 4117Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info0.Symbol).TypeArguments.Single().SpecialType); 4120Assert.Equal(SpecialType.System_Int32, ((ITypeSymbol)info1.Symbol).SpecialType); 4124Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info2.Symbol.OriginalDefinition).SpecialType); 4125Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info2.Symbol).TypeArguments.Single().SpecialType); 4171Assert.Equal(SpecialType.System_Int32, ((ITypeSymbol)info1.Symbol).SpecialType); 4175Assert.Equal(SpecialType.System_Collections_Generic_IEnumerable_T, ((ITypeSymbol)info2.Symbol.OriginalDefinition).SpecialType); 4176Assert.Equal(SpecialType.System_Int32, ((INamedTypeSymbol)info2.Symbol).TypeArguments.Single().SpecialType); 4215Assert.Null(info.Symbol); 4544Assert.Equal(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals), methodInfo.Symbol); 4788var lambda = (IMethodSymbol)symbolInfo.Symbol; 4831var methodSymbol = (IMethodSymbol)symbolInfo.Symbol; 4914Assert.Null(symbolInfo.Symbol); 5481Assert.Null(invocationInfo.Symbol); 5915Assert.Null(model.GetSymbolInfo(expr).Symbol); 6015Assert.Null(info.Symbol);
Compilation\GetUnusedImportDirectivesTests.cs (5)
196Assert.NotNull(info.Symbol); 197Assert.Equal(SymbolKind.NamedType, info.Symbol.Kind); 198Assert.Equal("Console", info.Symbol.Name); 199Assert.Equal(SymbolKind.Namespace, info.Symbol.ContainingSymbol.Kind); 200Assert.Equal("System", info.Symbol.ContainingSymbol.Name);
Compilation\IndexedProperties_BindingTests.cs (2)
143Assert.Equal(symbolKind, sym.Symbol.Kind); 144Assert.Equal(name, sym.Symbol.Name);
Compilation\SemanticModelAPITests.cs (98)
92Assert.NotNull(checkSymbolInfo(comp2).Symbol); 102Assert.Null(info.Symbol); 144var propertySymbol = (IPropertySymbol)symbolInfo.Symbol; 145Assert.NotNull(symbolInfo.Symbol); 154Assert.NotNull(symbolInfo.Symbol); 155Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind); 156Assert.Equal("Slice", symbolInfo.Symbol.Name); 179Assert.Null(assignmentInfo.Symbol); 205Assert.NotNull(rxInfo.Symbol); 206var rxSymbol = Assert.IsAssignableFrom<ILocalSymbol>(rxInfo.Symbol); 237Assert.NotNull(rxInfo.Symbol); 238var rxSymbol = Assert.IsAssignableFrom<ILocalSymbol>(rxInfo.Symbol); 335var symbol1 = model1.GetSymbolInfo(statement.Expression).Symbol; 336var symbol2 = model2.GetSymbolInfo(statement.Expression).Symbol; 538Assert.NotNull(info.Symbol); 540Assert.Equal(a, info.Symbol); 564Assert.NotNull(info.Symbol); 566Assert.Equal(b, info.Symbol); 590Assert.NotNull(info.Symbol); 591var cbasetype = info.Symbol as INamedTypeSymbol; 613Assert.NotNull(info.Symbol); 614var at2 = info.Symbol as INamedTypeSymbol; 679Assert.Equal(compilation.GlobalNamespace.GetTypeMembers("Program", 0).Single(), info.Symbol); 708Assert.Equal(compilation.GetSpecialType(SpecialType.System_String), (info.Symbol as IArrayTypeSymbol).ElementType); 731var lookup = symbolInfo.Symbol as ITypeSymbol; 799Assert.Equal(abType, info.Symbol); 823var cBaseType = model.GetSymbolInfo(cBase).Symbol; 1202var argsym1 = model.GetSymbolInfo(args.First().Expression).Symbol; 1203var argsym2 = model.GetSymbolInfo(args.Last().Expression).Symbol; 1366var symbol = info.Symbol; 1736Assert.Null(aliasDeclInfo.Symbol); 1747Assert.Equal(classQ, fieldTypeInfo.Symbol); 1800Assert.NotNull(info.Symbol); 1801Assert.Equal("z", info.Symbol.Name); 1802Assert.Equal(SymbolKind.Local, info.Symbol.Kind); 1807Assert.NotNull(info2.Symbol); 1808Assert.Equal("y", info2.Symbol.Name); 1809Assert.Equal(SymbolKind.Local, info2.Symbol.Kind); 2082var symbol = info.Symbol; 2099symbol = info.Symbol; 2115symbol = info.Symbol; 2406Assert.NotNull(info.Symbol); 2407Assert.Equal("z", info.Symbol.Name); 2408Assert.Equal(SymbolKind.Local, info.Symbol.Kind); 2414Assert.Null(info2.Symbol); 2610var param = speculativeModel.GetSymbolInfo(declarator.Initializer.Value).Symbol; 2713var symbol = speculativeModel.GetSymbolInfo(speculatedTypeSyntax).Symbol; 2727symbol = speculativeModel.GetSymbolInfo(right).Symbol; 2924var symbol = model.GetSymbolInfo(cref.Type).Symbol; 2936symbol = speculativeModel.GetSymbolInfo(speculatedCref.Type).Symbol; 2942symbol = model.GetSpeculativeSymbolInfo(cref.SpanStart, speculatedCref).Symbol; 2964var symbol = model.GetSymbolInfo(cref.Type).Symbol; 2976symbol = speculativeModel.GetSymbolInfo(speculatedCref.Name).Symbol; 2982symbol = model.GetSpeculativeSymbolInfo(cref.SpanStart, speculatedCref).Symbol; 3009var symbol = model.GetSymbolInfo(cref.Type).Symbol; 3021symbol = speculativeModel.GetSymbolInfo(speculatedCref).Symbol; 3026symbol = speculativeModel.GetSymbolInfo(speculatedCref.Member).Symbol; 3037symbol = model.GetSpeculativeSymbolInfo(cref.SpanStart, speculatedCref).Symbol; 3049symbol = speculativeModel.GetSymbolInfo(speculatedCref).Symbol; 3054symbol = speculativeModel.GetSymbolInfo(speculatedCref.Member).Symbol; 3065symbol = model.GetSpeculativeSymbolInfo(cref.SpanStart, speculatedCref).Symbol; 3102Assert.Null(symbolInfo.Symbol); 3131var symbol = model.GetSymbolInfo(syntax).Symbol; 3232Assert.Null(info.Symbol); 3261Assert.NotNull(info1.Symbol); 3273Assert.NotNull(info2.Symbol); 3275Assert.Equal(info1.Symbol, info2.Symbol); 3302Assert.NotNull(info1.Symbol); 3314Assert.NotNull(info2.Symbol); 3316Assert.Equal(info1.Symbol, info2.Symbol); 3343Assert.NotNull(info1.Symbol); 3348Assert.NotNull(info2.Symbol); 3350Assert.Equal(info1.Symbol, info2.Symbol); 3377Assert.NotNull(info1.Symbol); 3390Assert.NotNull(info2.Symbol); 3392Assert.Equal(info1.Symbol, info2.Symbol); 3419Assert.NotNull(info1.Symbol); 3431Assert.NotNull(info2.Symbol); 3433Assert.Equal(info1.Symbol, info2.Symbol); 3460Assert.NotNull(info1.Symbol); 3472Assert.NotNull(info2.Symbol); 3474Assert.Equal(info1.Symbol, info2.Symbol); 3501Assert.NotNull(info1.Symbol); 3506Assert.NotNull(info2.Symbol); 3508Assert.Equal(info1.Symbol, info2.Symbol); 3529Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString()); 3552Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString()); 3615var oldSymbol = symbolInfo.Symbol; 3622var newSymbol = speculativeSymbolInfo.Symbol; 4513Assert.Equal("(System.String a1, System.Int32 b1)", symbolInfo.Symbol.ToTestDisplayString()); 4591Assert.Equal("var", symbolInfo.Symbol.ToTestDisplayString());
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (38)
4007boundType = symbolInfo.Symbol as ITypeSymbol; 4013boundType = symbolInfo.Symbol as ITypeSymbol; 4019boundType = symbolInfo.Symbol as ITypeSymbol; 4025boundType = symbolInfo.Symbol as ITypeSymbol; 4031boundType = symbolInfo.Symbol as ITypeSymbol; 4037boundType = symbolInfo.Symbol as ITypeSymbol; 4043boundType = symbolInfo.Symbol as ITypeSymbol; 4049boundType = symbolInfo.Symbol as ITypeSymbol; 4054boundType = symbolInfo.Symbol as ITypeSymbol; 4060boundType = symbolInfo.Symbol as ITypeSymbol; 4131Assert.IsType<SourceOrdinaryMethodSymbol>(info.Symbol.GetSymbol()); 4148Assert.IsType<ReducedExtensionMethodSymbol>(info.Symbol.GetSymbol()); 4173Assert.NotNull(symbolInfo.Symbol); 4176Assert.Equal("System.ObsoleteAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()); 4181Assert.Null(symbolInfo.Symbol); 4191Assert.NotNull(symbolInfo.Symbol); 4194Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString()); 4199Assert.Null(symbolInfo.Symbol); 4206Assert.NotNull(symbolInfo.Symbol); 4209Assert.Equal("C.DAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()); 4215Assert.NotNull(symbolInfo.Symbol); 4218Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString()); 4224Assert.NotNull(symbolInfo.Symbol); 4227Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString()); 4257Assert.NotNull(symbolInfo.Symbol); 4260Assert.Equal("System.ObsoleteAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()); 4268Assert.Null(symbolInfo.Symbol); 4285Assert.NotNull(symbolInfo.Symbol); 4288Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString()); 4307Assert.Null(symbolInfo.Symbol); 4318Assert.NotNull(symbolInfo.Symbol); 4321Assert.Equal("C.DAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()); 4331Assert.NotNull(symbolInfo.Symbol); 4334Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString()); 4354Assert.NotNull(symbolInfo.Symbol); 4357Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString()); 4376Assert.NotNull(symbolInfo.Symbol); 4379Assert.Equal("System.ObsoleteAttribute..ctor(System.String message)", symbolInfo.Symbol.ToTestDisplayString());
Compilation\SemanticModelGetSemanticInfoTests.cs (10)
8274Assert.Null(symbolInfo.Symbol); 12132Assert.Null(symbolInfo.Symbol); 14798Assert.Equal("Test.C", symbolInfo.Symbol.ToTestDisplayString()); 14813Assert.Equal("Test.C..ctor()", symbolInfo.Symbol.ToTestDisplayString()); 14894Assert.Equal("Test.I", symbolInfo.Symbol.ToTestDisplayString()); 14909Assert.Equal("Test.CoClassI..ctor()", symbolInfo.Symbol.ToTestDisplayString()); 15005Assert.Equal("Test.I", symbolInfo.Symbol.ToTestDisplayString()); 15020Assert.Null(symbolInfo.Symbol); 15377var infoSymbol = semanticModel.GetQueryClauseInfo(qc).OperationInfo.Symbol; 15381var infoSymbol2 = semanticModel.GetSymbolInfo(qe.Body.SelectOrGroup).Symbol;
DocumentationComments\CrefTests.cs (130)
305AssertEx.All(crefSyntaxes, cref => model.GetSymbolInfo(cref).Symbol == null); 1817Assert.Equal(info.Symbol, actualSymbol.ISymbol); 2016Assert.Null(info.Symbol); 2055Assert.Null(info.Symbol); 2109Assert.Null(info.Symbol); 2946var actualSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 2970var actualTypeSymbol = model.GetSymbolInfo(crefSyntax.Container).Symbol; 2973var actualMethodSymbol1 = model.GetSymbolInfo(crefSyntax.Member).Symbol; 2976var actualMethodSymbol2 = model.GetSymbolInfo(((NameMemberCrefSyntax)crefSyntax.Member).Name).Symbol; 3012var actualTypeA = (INamedTypeSymbol)model.GetSymbolInfo(left).Symbol; 3017var actualTypeArgument = model.GetSymbolInfo(left.TypeArgumentList.Arguments.Single()).Symbol; 3024var actualTypeB = (INamedTypeSymbol)model.GetSymbolInfo(containingTypeSyntax).Symbol; 3030Assert.Equal(actualTypeB, model.GetSymbolInfo(right).Symbol); 3032var actualTypeArgument = model.GetSymbolInfo(right.TypeArgumentList.Arguments.Single()).Symbol; 3039var actualMethod = (IMethodSymbol)model.GetSymbolInfo(crefSyntax).Symbol; 3044Assert.Equal(actualMethod, model.GetSymbolInfo(crefSyntax.Member).Symbol); 3045Assert.Equal(actualMethod, model.GetSymbolInfo(nameMemberSyntax.Name).Symbol); 3047var actualParameterTypes = nameMemberSyntax.Parameters.Parameters.Select(syntax => model.GetSymbolInfo(syntax.Type).Symbol).ToArray(); 3075var actualIndexer = model.GetSymbolInfo(crefSyntax).Symbol; 3079var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3102var actualOperator = model.GetSymbolInfo(crefSyntax).Symbol; 3106var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3129var actualOperator = model.GetSymbolInfo(crefSyntax).Symbol; 3133var actualParameterType = model.GetSymbolInfo(crefSyntax.Parameters.Parameters.Single().Type).Symbol; 3137var actualReturnType = model.GetSymbolInfo(crefSyntax.Type).Symbol; 3158Assert.Null(info.Symbol); 3181Assert.Null(info.Symbol); 3204Assert.Null(info.Symbol); 3227Assert.Null(info.Symbol); 3251Assert.Null(info.Symbol); 3275Assert.Null(info.Symbol); 3299Assert.Null(info.Symbol); 3323Assert.Null(info.Symbol); 3346Assert.Null(info.Symbol); 4701var symbols = crefSyntaxes.Select(cref => model.GetSymbolInfo(cref).Symbol).ToArray(); 4757var symbols = crefSyntaxes.Select(cref => model.GetSymbolInfo(cref).Symbol).ToArray(); 4789Assert.Equal(overridingMethod, model.GetSymbolInfo(cref).Symbol); 4823Assert.Null(model.GetSymbolInfo(cref).Symbol); // As in dev11. 4851Assert.Equal(overridingMethod, model.GetSymbolInfo(cref).Symbol); 4878Assert.Equal(overridingMethod, model.GetSymbolInfo(cref).Symbol); 4911Assert.Null(model.GetSymbolInfo(cref).Symbol); // As in dev11. 4939Assert.Equal(overridingMethod, model.GetSymbolInfo(cref).Symbol); 4984Assert.Equal(derivedM1, model.GetSymbolInfo(crefs[0]).Symbol); 4985Assert.Null(model.GetSymbolInfo(crefs[1]).Symbol); 4986Assert.Null(model.GetSymbolInfo(crefs[2]).Symbol); 5014Assert.Equal(constructor, model.GetSymbolInfo(crefs[0]).Symbol.OriginalDefinition); 5015Assert.Equal(constructor, model.GetSymbolInfo(crefs[1]).Symbol.OriginalDefinition); 5017Assert.Null(model.GetSymbolInfo(crefs[2]).Symbol); 5018Assert.Equal(constructor, model.GetSymbolInfo(crefs[3]).Symbol.OriginalDefinition); 5047Assert.Null(model.GetSymbolInfo(cref).Symbol); 5145Assert.Null(model.GetSymbolInfo(crefs[0]).Symbol); 5146Assert.Null(model.GetSymbolInfo(crefs[3]).Symbol); 5147Assert.Null(model.GetSymbolInfo(crefs[5]).Symbol); 5148Assert.Null(model.GetSymbolInfo(crefs[7]).Symbol); 5150Assert.Equal(type, model.GetSymbolInfo(crefs[1]).Symbol.OriginalDefinition); 5151Assert.Equal(nonGenericMethod, model.GetSymbolInfo(crefs[2]).Symbol.OriginalDefinition); 5152Assert.Equal(genericMethod, model.GetSymbolInfo(crefs[4]).Symbol.OriginalDefinition); 5153Assert.Equal(genericMethod, model.GetSymbolInfo(crefs[6]).Symbol.OriginalDefinition); 5178Assert.Null(model.GetSymbolInfo(cref).Symbol); 5200Assert.Null(model.GetSymbolInfo(cref).Symbol); 5244Assert.Equal(m1a, model.GetSymbolInfo(crefs[0]).Symbol.OriginalDefinition); 5245Assert.Equal(m1b, model.GetSymbolInfo(crefs[1]).Symbol.OriginalDefinition); 5246Assert.Equal(m2a, model.GetSymbolInfo(crefs[2]).Symbol.OriginalDefinition); 5247Assert.Equal(m2b, model.GetSymbolInfo(crefs[3]).Symbol.OriginalDefinition); 5249Assert.Equal(m1a, model.GetSymbolInfo(crefs[4]).Symbol.OriginalDefinition); 5250Assert.Equal(m1b, model.GetSymbolInfo(crefs[5]).Symbol.OriginalDefinition); 5251Assert.Equal(m2a, model.GetSymbolInfo(crefs[6]).Symbol.OriginalDefinition); 5252Assert.Equal(m2b, model.GetSymbolInfo(crefs[7]).Symbol.OriginalDefinition); 5286Assert.Null(model.GetSymbolInfo(cref).Symbol); 5312Assert.Null(model.GetSymbolInfo(cref).Symbol); 5338Assert.Null(model.GetSymbolInfo(cref).Symbol); 5364Assert.Null(model.GetSymbolInfo(cref).Symbol); 5403Assert.Equal(compilation.GetSpecialType(SpecialType.System_Int32), model.GetSymbolInfo(crefSyntaxes[0]).Symbol); 5404Assert.Equal(compilation.GetSpecialType(SpecialType.System_Int64), model.GetSymbolInfo(crefSyntaxes[1]).Symbol); 5426Assert.Equal("System.IntPtr System.IntPtr.op_Explicit(System.Void* value)", model.GetSymbolInfo(cref).Symbol.ToTestDisplayString()); 5446Assert.Equal(compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C"), model.GetSymbolInfo(cref).Symbol); 5473Assert.Equal(expectedSymbol, model.GetSymbolInfo(cref).Symbol); 5495Assert.Equal(expectedSymbol, model.GetSymbolInfo(cref).Symbol.OriginalDefinition); 5560var referencedType = (INamedTypeSymbol)model.GetSymbolInfo(cref).Symbol; 5598var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5628var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5660Assert.Null(model.GetSymbolInfo(cref).Symbol); 5699Assert.Null(model.GetSymbolInfo(id).Symbol); //Used to assert/throw. 5716var symbol = model.GetSymbolInfo(cref).Symbol; 5750Assert.Null(info.Symbol); 5755Assert.IsType<CrefTypeParameterSymbol>(containingTypeInfo.Symbol.GetSymbol()); 5798var typeSymbol = model.GetSymbolInfo(typeSyntax).Symbol; 5854var symbol = model.GetSymbolInfo(cref).Symbol; 5903var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5927var actualSymbol = model.GetSymbolInfo(cref).Symbol; 5952Assert.Null(info.Symbol); 5976var actualSymbol = model.GetSymbolInfo(cref).Symbol; 6001Assert.Null(info.Symbol); 6028var actualSymbol = model.GetSymbolInfo(cref).Symbol; 6050var typeParameterSymbol = model.GetSymbolInfo(typeParameterSyntax).Symbol; 6074var methodSymbol = model.GetSymbolInfo(methodNameSyntax).Symbol; 6111var actualReturnTypeSymbol = model.GetSymbolInfo(returnTypeSyntax).Symbol; 6115var actualCrefSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 6149var actualParameterTypeSymbol = model.GetSymbolInfo(parameterTypeSyntax).Symbol; 6153var actualCrefSymbol = model.GetSymbolInfo(crefSyntax).Symbol; 6191var parameterTypeSymbol = model.GetSymbolInfo(parameterTypeSyntax).Symbol; 6218Assert.Equal(compilation.GetSpecialType(SpecialType.System_Int32), info.Symbol); 6219Assert.Equal(info.Symbol, alias.Target); 6251Assert.Equal(compilation.GetSpecialType(SpecialType.System_Int32), info.Symbol); 6252Assert.Equal(info.Symbol, alias.Target); 6281Assert.NotNull(symbolInfo.Symbol); 6282Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind); 6283Assert.Equal("System.Action<System.Int32> P.b", symbolInfo.Symbol.ToTestDisplayString()); 6287Assert.NotNull(symbolInfo.Symbol); 6288Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind); 6289Assert.Equal("System.Action<System.Int32> P.b", symbolInfo.Symbol.ToTestDisplayString()); 6297Assert.NotNull(symbolInfo.Symbol); 6298Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind); 6299Assert.Equal("System.Action<System.Int32> P.b", symbolInfo.Symbol.ToTestDisplayString()); 6348Assert.Equal(accessor, crefInfo.Symbol); 6364Assert.Equal(inheritedType, returnInfo.Symbol); 6365Assert.Equal(inheritedType, paramInfo.Symbol); 6431Assert.Null(info.Symbol); 6469Assert.Null(info.Symbol); 6503Assert.Equal(outer, model.GetSymbolInfo(crefs[0]).Symbol.OriginalDefinition); 6504Assert.Equal(inner, model.GetSymbolInfo(crefs[1]).Symbol.OriginalDefinition); 6535var actualSymbol0 = model.GetSymbolInfo(crefs[0]).Symbol; 6538var actualSymbol1 = model.GetSymbolInfo(crefs[1]).Symbol; 6562Assert.Equal(compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C"), model.GetSymbolInfo(cref).Symbol); 6584Assert.Equal(compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("C"), model.GetSymbolInfo(cref).Symbol); 6607Assert.Equal(compilation.GlobalNamespace.GetMember<INamedTypeSymbol>("Cat"), model.GetSymbolInfo(cref).Symbol); 6647return crefs.Select(syntax => model.GetSymbolInfo(syntax).Symbol).Select(symbol => (object)symbol == null ? null : symbol.OriginalDefinition).ToArray(); 6676var typeParameter = (ITypeParameterSymbol)model.GetSymbolInfo(name).Symbol; 6707var parameterSymbol = ((IMethodSymbol)model.GetSymbolInfo(cref).Symbol).Parameters.Single(); 6871var symbol = model.GetSymbolInfo(crefSyntaxes.Single()).Symbol;
DocumentationComments\DocumentationCommentIDTests.cs (1)
145var symbol = model.GetSymbolInfo(syntax).Symbol;
DocumentationComments\ParameterTests.cs (36)
41Assert.Equal(typeParameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 42Assert.Equal(typeParameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(1)).Symbol); 65Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 66Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(1)).Symbol); 89Assert.Equal(typeParameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 90Assert.Equal(typeParameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(1)).Symbol); 114Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 115Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(1)).Symbol); 143Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 144Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(1)).Symbol); 168Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 169Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(1)).Symbol); 281Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 306Assert.Equal(parameters.ElementAt(0), model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 307Assert.Equal(parameters.ElementAt(1), model.GetSymbolInfo(nameSyntaxes.ElementAt(1)).Symbol); 308Assert.Equal(parameters.ElementAt(2), model.GetSymbolInfo(nameSyntaxes.ElementAt(2)).Symbol); 383Assert.Equal(typeParameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(0)).Symbol); 384Assert.Equal(parameter, model.GetSymbolInfo(nameSyntaxes.ElementAt(1)).Symbol); 695Assert.Equal(method.Parameters[0], model.GetSymbolInfo(nameSyntaxes[0]).Symbol); 696Assert.Equal(method.Parameters[1], model.GetSymbolInfo(nameSyntaxes[1]).Symbol); 750Assert.Equal(expectedParameter, model.GetSymbolInfo(names[0]).Symbol); 751Assert.Equal(expectedParameter, model.GetSymbolInfo(names[1]).Symbol); 752Assert.Equal(expectedTypeParameter, model.GetSymbolInfo(names[2]).Symbol); 753Assert.Equal(expectedTypeParameter, model.GetSymbolInfo(names[3]).Symbol); 809Assert.Null(model.GetSymbolInfo(names[0]).Symbol); 810Assert.Equal(expectedTypeParameter, model.GetSymbolInfo(names[1]).Symbol); 813Assert.Equal(expectedParameter, model.GetSymbolInfo(names[2]).Symbol); 814Assert.Equal(expectedParameter, model.GetSymbolInfo(names[3]).Symbol); 817Assert.Equal(expectedValueParameter, model.GetSymbolInfo(names[4]).Symbol); 818Assert.Equal(expectedValueParameter, model.GetSymbolInfo(names[5]).Symbol); 823Assert.Null(model.GetSymbolInfo(names[6]).Symbol); 824Assert.Equal(expectedTypeParameter, model.GetSymbolInfo(names[7]).Symbol); 827Assert.Equal(expectedParameter, model.GetSymbolInfo(names[8]).Symbol); 828Assert.Equal(expectedParameter, model.GetSymbolInfo(names[9]).Symbol); 831Assert.Equal(expectedValueParameter, model.GetSymbolInfo(names[10]).Symbol); 832Assert.Equal(expectedValueParameter, model.GetSymbolInfo(names[11]).Symbol);
SymbolDisplay\SymbolDisplayTests.cs (6)
5321SymbolDisplay.ToDisplayParts(model.GetSymbolInfo(actualThis).Symbol, SymbolDisplayFormat.MinimallyQualifiedFormat), 5331SymbolDisplay.ToDisplayParts(model.GetSymbolInfo(escapedThis).Symbol, SymbolDisplayFormat.MinimallyQualifiedFormat), 7603var symbol = model.GetSymbolInfo(variable).Symbol; 7697var symbol = model.GetSymbolInfo(constructor).Symbol; 7757var symbol = model.GetSymbolInfo(constructor).Symbol; 8557var op = model.GetSymbolInfo(binaryExpression).Symbol;
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (4)
1028var localD = (ILocalSymbol)semanticModel.GetSymbolInfo(identifierSyntax).Symbol; 1033var methodDispose = (IMethodSymbol)semanticModel.GetSymbolInfo(memberAccessSyntax).Symbol; 1044var isInterfaceNameBound = semanticModel.GetSymbolInfo(interfaceName).Symbol is INamedTypeSymbol; 1051var methodSymbol = semanticModel.GetSymbolInfo(memberAccessed).Symbol as IMethodSymbol;
Symbols\AnonymousTypesSemanticsTests.cs (17)
755Assert.NotNull(info.Symbol); 756Assert.Equal(SymbolKind.Property, info.Symbol.Kind); 757Assert.Equal("System.Type <anonymous type: System.Type F123>.F123 { get; }", info.Symbol.ToTestDisplayString()); 778Assert.NotNull(info1.Symbol); 779Assert.Equal(SymbolKind.RangeVariable, info1.Symbol.Kind); 780Assert.Equal("x", info1.Symbol.ToDisplayString()); 783Assert.NotNull(info2.Symbol); 784Assert.Equal(SymbolKind.Property, info2.Symbol.Kind); 785Assert.Equal("System.Int32 <anonymous type: System.Int32 x, System.Int32 y>.y { get; }", info2.Symbol.ToTestDisplayString()); 847Assert.NotNull(info1.Symbol); 848Assert.Equal(SymbolKind.RangeVariable, info1.Symbol.Kind); 849Assert.Equal("x", info1.Symbol.ToDisplayString()); 852Assert.NotNull(info2.Symbol); 853Assert.Equal(SymbolKind.RangeVariable, info2.Symbol.Kind); 854Assert.Equal("y", info2.Symbol.ToDisplayString()); 1539Assert.NotNull(info.Symbol); 1540Assert.Equal("<anonymous type: int a>.a", info.Symbol.ToDisplayString());
Symbols\AnonymousTypesSymbolTests.cs (4)
1643Assert.NotNull(sym.Symbol); 1644Assert.True(sym.Symbol.GetSymbol().IsFromCompilation(comp), "IsFromCompilation"); 1645Assert.False(sym.Symbol.Locations.IsEmpty, "Symbol Location"); 1646Assert.True(sym.Symbol.Locations[0].IsInSource);
Symbols\CheckedUserDefinedOperatorsTests.cs (17)
7213Assert.Equal("System.Int64 C0.op_CheckedExplicit(C0 x)", model.GetSymbolInfo(xNode.Parent).Symbol.ToTestDisplayString()); 7214Assert.Equal("System.Int64 C0.op_CheckedExplicit(C0 x)", model.GetSymbolInfo(yNode.Parent).Symbol.ToTestDisplayString()); 7216var int64 = ((IMethodSymbol)model.GetSymbolInfo(xNode.Parent).Symbol).ReturnType; 7285Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.GetSymbolInfo(xNode.Parent).Symbol.ToTestDisplayString()); 7286Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.GetSymbolInfo(yNode.Parent).Symbol.ToTestDisplayString()); 7288var int64 = ((IMethodSymbol)model.GetSymbolInfo(xNode.Parent).Symbol).ReturnType; 7356Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.GetSymbolInfo(xNode.Parent).Symbol.ToTestDisplayString()); 7357Assert.Equal("System.Int64 C0.op_Explicit(C0 x)", model.GetSymbolInfo(yNode.Parent).Symbol.ToTestDisplayString()); 7359var int64 = ((IMethodSymbol)model.GetSymbolInfo(xNode.Parent).Symbol).ReturnType; 7429Assert.Equal("C0 C0.op_CheckedUnaryNegation(C0 a)", model.GetSymbolInfo(xNode.Parent).Symbol.ToTestDisplayString()); 7430Assert.Equal("C0 C0.op_CheckedUnaryNegation(C0 a)", model.GetSymbolInfo(yNode.Parent).Symbol.ToTestDisplayString()); 7435Assert.Equal("C0 C0.op_CheckedUnaryNegation(C0 a)", model.GetSpeculativeSymbolInfo(xNode.SpanStart, xNodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString()); 7436Assert.Equal("C0 C0.op_CheckedUnaryNegation(C0 a)", model.GetSpeculativeSymbolInfo(yNode.SpanStart, yNodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString()); 7493Assert.Equal("C0 C0.op_UnaryNegation(C0 a)", model.GetSymbolInfo(xNode.Parent).Symbol.ToTestDisplayString()); 7494Assert.Equal("C0 C0.op_UnaryNegation(C0 a)", model.GetSymbolInfo(yNode.Parent).Symbol.ToTestDisplayString()); 7499Assert.Equal("C0 C0.op_UnaryNegation(C0 a)", model.GetSpeculativeSymbolInfo(xNode.SpanStart, xNodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString()); 7500Assert.Equal("C0 C0.op_UnaryNegation(C0 a)", model.GetSpeculativeSymbolInfo(yNode.SpanStart, yNodeToSpeculate, SpeculativeBindingOption.BindAsExpression).Symbol.ToTestDisplayString());
Symbols\ConversionTests.cs (3)
1730Assert.Null(castInfo.Symbol); 1799var symbol = model.GetSymbolInfo(syntax).Symbol; 1833var symbol = model.GetSymbolInfo(syntax).Symbol;
Symbols\DestructorTests.cs (1)
418Assert.Equal(destructor, info.Symbol);
Symbols\ExtensionMethodTests.cs (10)
227syntaxTree.GetCompilationUnitRoot().DescendantNodes().OfType<MemberAccessExpressionSyntax>().Single()).Symbol; 2440Assert.NotNull(info.Symbol); 2441var symbol = info.Symbol; 2735var methodSymbol = symbolInfo.Symbol.GetSymbol<MethodSymbol>(); 2745methodSymbol = (MethodSymbol)symbolInfo.Symbol.GetSymbol<MethodSymbol>(); 3022Assert.Null(info.Symbol); 3150var firstInvocationSymbol = model.GetSymbolInfo(firstInvocation).Symbol; 3151var firstInvocationExpressionSymbol = model.GetSymbolInfo(firstInvocationExpression).Symbol; 3155var secondInvocationSymbol = model.GetSymbolInfo(secondInvocation).Symbol; 3156var secondInvocationExpressionSymbol = model.GetSymbolInfo(secondInvocationExpression).Symbol;
Symbols\FunctionPointerTypeSymbolTests.cs (1)
1164var a = (ILocalSymbol)model.GetSymbolInfo(misplacedDeclaration).Symbol!;
Symbols\ImplicitClassTests.cs (1)
76Assert.Null(model.GetSymbolInfo(toStringIdentifier).Symbol);
Symbols\IndexerTests.cs (5)
1296Assert.Equal(baseIndexer.GetPublicSymbol(), symbolInfo.Symbol); 2530var actual = GetElementAccessExpressions(tree.GetCompilationUnitRoot()).Select(syntax => model.GetSymbolInfo(syntax).Symbol.ToTestDisplayString()); 2845Assert.NotNull(idxSymbol2.Symbol); 2846Assert.Equal(WellKnownMemberNames.Indexer, idxSymbol2.Symbol.Name); 2847Assert.Equal("Item", idxSymbol2.Symbol.MetadataName);
Symbols\Metadata\MetadataTypeTests.cs (2)
374Assert.NotNull(symInfo.Symbol); 388Assert.NotNull(symInfo.Symbol);
Symbols\MethodEqualityTests.cs (1)
217return (IMethodSymbol)semanticInfo.Symbol;
Symbols\RelaxedShiftOperatorTests.cs (6)
105Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString()); 149Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString()); 193Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString()); 237Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString()); 281Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString()); 325Assert.Equal("C1.operator " + op + "(C1, C2)", model.GetSymbolInfo(shift).Symbol.ToDisplayString());
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
156var sym = model.GetSymbolInfo(node).Symbol as IMethodSymbol;
Symbols\Source\DelegateTests.cs (4)
741var parameter = model.GetSymbolInfo(anonymousMethod).Symbol.GetParameters()[0]; 769Assert.Empty(model.GetSymbolInfo(anonymousMethod).Symbol.GetParameters()); 829var lambda = (IMethodSymbol)model.GetSymbolInfo(lambdaSyntax).Symbol; 836lambda = (IMethodSymbol)model.GetSymbolInfo(lambdaSyntax).Symbol;
Symbols\Source\ExternAliasTests.cs (3)
499Assert.Equal(typeC, qualifiedNameInfo.Symbol); 502Assert.Equal(typeC.ContainingNamespace, aliasQualifiedNameInfo.Symbol); 505Assert.Equal(aliasedGlobalNamespace, aliasNameInfo.Symbol);
Symbols\Source\FileModifierTests.cs (9)
2225Assert.Equal(expectedSymbol.GetPublicSymbol(), symbolInfo.Symbol); 2264Assert.Equal(expectedSymbol.GetPublicSymbol(), symbolInfo.Symbol); 2954Assert.Equal(expectedMember.GetPublicSymbol(), symbolInfo.Symbol); 3003Assert.Equal(expectedMember.GetPublicSymbol(), symbolInfo.Symbol); 3056Assert.Equal(expected, symbolInfo.Symbol.GetSymbol()); 3088Assert.Equal("void NS.C@<tree 0>.M()", info.Symbol.ToTestDisplayString()); 3158Assert.Null(info.Symbol); 3222Assert.Equal(compilation.GetMember("C.M").GetPublicSymbol(), info.Symbol); 3263Assert.Null(info.Symbol);
Symbols\Source\LocalTests.cs (1)
63var local = (ILocalSymbol)model.GetSymbolInfo(expressionSyntax).Symbol!;
Symbols\Source\NullablePublicAPITests.cs (104)
946var method = (IMethodSymbol)model.GetSymbolInfo(inv).Symbol; 1855verifySymbolInfo((IMethodSymbol)symbolInfo.Symbol, PublicNullableAnnotation.Annotated); 1857verifySymbolInfo((IMethodSymbol)symbolInfo.Symbol, PublicNullableAnnotation.NotAnnotated); 1898verifySymbolInfo((IMethodSymbol)symbolInfo.Symbol, PublicNullableAnnotation.Annotated); 1900verifySymbolInfo((IMethodSymbol)symbolInfo.Symbol, PublicNullableAnnotation.NotAnnotated); 2634IParameterSymbol symbol = (IParameterSymbol)info.Symbol; 2667Assert.Null(symbolInfo.Symbol); 2705Assert.Null(symbolInfo.Symbol); 2741Assert.Equal(PublicNullableAnnotation.Annotated, ((IPropertySymbol)symInfo.Symbol).NullableAnnotation); 2742Assert.Equal(PublicNullableAnnotation.Annotated, ((IPropertySymbol)symInfo.Symbol).Type.NullableAnnotation); 2743Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2744Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2746Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IPropertySymbol)symInfo.Symbol).NullableAnnotation); 2747Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IPropertySymbol)symInfo.Symbol).Type.NullableAnnotation); 2748Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2749Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2787Assert.Equal(PublicNullableAnnotation.Annotated, ((IFieldSymbol)symInfo.Symbol).NullableAnnotation); 2788Assert.Equal(PublicNullableAnnotation.Annotated, ((IFieldSymbol)symInfo.Symbol).Type.NullableAnnotation); 2789Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2790Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2792Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IFieldSymbol)symInfo.Symbol).NullableAnnotation); 2793Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IFieldSymbol)symInfo.Symbol).Type.NullableAnnotation); 2794Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2795Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2830Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).NullableAnnotation); 2831Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2832Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2833Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2835Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).NullableAnnotation); 2836Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2837Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2838Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2840var event1 = model.GetSymbolInfo(memberAccess[2]).Symbol; 2841var event2 = model.GetSymbolInfo(memberAccess[3]).Symbol; 2879Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).NullableAnnotation); 2880Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2881Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2882Assert.Equal(PublicNullableAnnotation.Annotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2884Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).NullableAnnotation); 2885Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2886Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]); 2887Assert.Equal(PublicNullableAnnotation.NotAnnotated, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First()); 2968Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArgumentNullableAnnotations[0]); 2969Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArguments[0].NullableAnnotation); 3010Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArgumentNullableAnnotations[0]); 3011Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArguments[0].NullableAnnotation); 3052Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IMethodSymbol)symbolInfo.Symbol).TypeArgumentNullableAnnotations[0]); 3053Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IMethodSymbol)symbolInfo.Symbol).TypeArguments[0].NullableAnnotation); 3054Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArgumentNullableAnnotations[1]); 3055Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArguments[1].NullableAnnotation); 3112Assert.Null(symbolInfo.Symbol); 3158var methodSymbol = ((IMethodSymbol)symbolInfo.Symbol); 3203var methodSymbol = ((IMethodSymbol)symbolInfo.Symbol); 3266var propertySymbol = (IPropertySymbol)model.GetSymbolInfo(indexers[0]).Symbol; 3268propertySymbol = (IPropertySymbol)model.GetSymbolInfo(indexers[1]).Symbol; 3317var propertySymbol = (IPropertySymbol)model.GetSymbolInfo(indexers[0]).Symbol; 3319propertySymbol = (IPropertySymbol)model.GetSymbolInfo(indexers[1]).Symbol; 3366var propertySymbol = (IMethodSymbol)model.GetSymbolInfo(indexer).Symbol; 3412var method = (IMethodSymbol)model.GetSymbolInfo(syntax).Symbol; 3457var method = (IMethodSymbol)model.GetSymbolInfo(syntax).Symbol; 3490var lambdaSymbol = (IMethodSymbol)model.GetSymbolInfo(lambda).Symbol; 3503var parameterSymbol = (IParameterSymbol)model.GetSymbolInfo(o1Ref).Symbol; 3539var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3543var innerLambdaSymbol = (IMethodSymbol)model.GetSymbolInfo(innerLambda).Symbol; 3557var o1Symbol = (IParameterSymbol)model.GetSymbolInfo(o1Ref).Symbol; 3568var o2Symbol = (IParameterSymbol)model.GetSymbolInfo(o2Ref).Symbol; 3600var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3604var innerLambdaSymbol = (IMethodSymbol)model.GetSymbolInfo(innerLambda).Symbol; 3618var o1Symbol = (IParameterSymbol)model.GetSymbolInfo(o1Ref).Symbol; 3629var o2Symbol = (IParameterSymbol)model.GetSymbolInfo(o2Ref).Symbol; 3663var lambdaSymbol = (IMethodSymbol)model.GetSymbolInfo(lambda).Symbol; 3669var o2Symbol = model.GetSymbolInfo(o2Reference).Symbol; 3777var parameterSymbol = (IParameterSymbol)model.GetSymbolInfo(o1Ref).Symbol; 3785Assert.Equal(parameterSymbol, info.Symbol, SymbolEqualityComparer.IncludeNullability); 3810var lambdaSymbol = (IMethodSymbol)model.GetSymbolInfo(lambda).Symbol; 3856var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3867Assert.Equal(o2Symbol, o2Ref.Symbol, SymbolEqualityComparer.IncludeNullability); 3915var fieldLambdaSymbol = model.GetSymbolInfo(fieldLambda).Symbol; 3917var o1Symbol = (IParameterSymbol)model.GetSymbolInfo(o1Reference).Symbol; 3929var propertyLambdaSymbol = model.GetSymbolInfo(propertyLambda).Symbol; 3931var o3Symbol = (IParameterSymbol)model.GetSymbolInfo(o3Reference).Symbol; 3980var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 3983var innerLambdaSymbol1 = (IMethodSymbol)model.GetSymbolInfo(innerLambda1).Symbol; 3993var innerLambdaSymbol2 = (IMethodSymbol)model.GetSymbolInfo(innerLambda2).Symbol; 4055var o1RefSymbol = model.GetSymbolInfo(o1Ref).Symbol; 4058var o2RefSymbol = model.GetSymbolInfo(o2Ref).Symbol; 4068Assert.Equal(o2Symbol, speculativeModel.GetSymbolInfo(speculativeO2Ref).Symbol, SymbolEqualityComparer.IncludeNullability); 4073Assert.Equal(o1Symbol, speculativeModel.GetSymbolInfo(speculativeO1Ref).Symbol, SymbolEqualityComparer.IncludeNullability); 4116var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 4179var lambdaSymbol = model.GetSymbolInfo(lambda).Symbol; 4219Assert.Equal(SpecialType.System_String, ((IFieldSymbol)symbolInfo.Symbol).Type.SpecialType); 4373Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4401Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4431Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4461Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4491Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4523Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4556Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4584Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4614Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4645Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4678Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4703var symbol2 = (IMethodSymbol)model.GetSpeculativeSymbolInfo(initializer.Position, expression, SpeculativeBindingOption.BindAsExpression).Symbol; 4782var actualAnnotations = invocations.Select(inv => (((IMethodSymbol)model.GetSymbolInfo(inv).Symbol)).TypeArguments[0].NullableAnnotation).ToArray();
Symbols\Source\UsingAliasTests.cs (8)
312var info2 = symbolInfo.Symbol as ITypeSymbol; 318var info3 = symbolInfo.Symbol as ITypeSymbol; 324var info4 = symbolInfo.Symbol as ITypeSymbol; 358var info2 = symbolInfo.Symbol as ITypeSymbol; 364var info3 = symbolInfo.Symbol as ITypeSymbol; 370var info4 = symbolInfo.Symbol as ITypeSymbol; 709Assert.Null(symbolInfo.Symbol); 752Assert.Null(symbolInfo.Symbol);
Symbols\SymbolEqualityTests.cs (14)
43var nonNullPlus = (IMethodSymbol)model.GetSymbolInfo(invocations[0]).Symbol; 44var nullPlus = (IMethodSymbol)model.GetSymbolInfo(invocations[1]).Symbol; 86var nonNullStringExt = (IMethodSymbol)model.GetSymbolInfo(invocations[0]).Symbol; 89var nullStringExt = (IMethodSymbol)model.GetSymbolInfo(invocations[1]).Symbol; 126var nonNullM = model.GetSymbolInfo(invocations[0]).Symbol; 127var nullM = model.GetSymbolInfo(invocations[1]).Symbol; 167var nonNullM = (IMethodSymbol)model.GetSymbolInfo(invocations[0]).Symbol; 168var nullM = (IMethodSymbol)model.GetSymbolInfo(invocations[1]).Symbol; 595var create1Symbol = model.GetSymbolInfo(create1Syntax).Symbol; 596var create2Symbol = model.GetSymbolInfo(create2Syntax).Symbol; 782var field2 = (IFieldSymbol)model.GetSymbolInfo(member2Syntax).Symbol; // A<T!>! A<T!>.field 833var method2 = (IMethodSymbol)model.GetSymbolInfo(member2Syntax).Symbol; // A<T!>! A<T!>.M(A<T!>! t) 894var event2 = (IEventSymbol)model.GetSymbolInfo(member2Syntax).Symbol; // System.EventHandler<T!>! A<T!>.MyEvent 939var lambdaSymbol = (IMethodSymbol)semanticModel1.GetSymbolInfo(lambdaSyntax).Symbol;
Symbols\SymbolExtensionTests.cs (5)
103var anonymousType = model.GetSymbolInfo(identifier).Symbol.GetSymbol<TypeSymbol>(); 121var anonymousType = model.GetSymbolInfo(identifier).Symbol.GetSymbol<TypeSymbol>(); 139var anonymousType = model.GetSymbolInfo(identifier).Symbol.GetSymbol<TypeSymbol>(); 158var anonymousType = model.GetSymbolInfo(identifier).Symbol.GetSymbol<TypeSymbol>(); 252var method = model.GetSymbolInfo(tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(id => id.Identifier.ValueText == "Method").Single()).Symbol.GetSymbol<MethodSymbol>();
Symbols\TypeTests.cs (1)
1854var symbol = info.Symbol;
Symbols\UnsignedRightShiftTests.cs (13)
129var unsignedShiftSymbol = (IMethodSymbol)model.GetSymbolInfo(unsignedShift).Symbol; 130var shiftSymbol = (IMethodSymbol)model.GetSymbolInfo(shift).Symbol; 632var unsignedShiftSymbol = (IMethodSymbol)model.GetSymbolInfo(unsignedShift).Symbol; 633var shiftSymbol = (IMethodSymbol)model.GetSymbolInfo(shift).Symbol; 1182var unsignedShiftSymbol = (IMethodSymbol)model.GetSymbolInfo(unsignedShift).Symbol; 1183var shiftSymbol = (IMethodSymbol)model.GetSymbolInfo(shift).Symbol; 1590var unsignedShiftSymbol = (IMethodSymbol)model.GetSymbolInfo(unsignedShift).Symbol; 1591var shiftSymbol = (IMethodSymbol)model.GetSymbolInfo(shift).Symbol; 1986Assert.Equal("C1 C1.op_UnsignedRightShift(C1 x, System.Int32 y)", model.GetSymbolInfo(unsignedShift).Symbol.ToTestDisplayString()); 2238Assert.Equal("C1 C1.op_UnsignedRightShift(C1? x, System.Int32? y)", model.GetSymbolInfo(unsignedShift).Symbol.ToTestDisplayString()); 2380Assert.Equal("C1 C1.op_UnsignedRightShift(C1 x, System.Int32 y)", model.GetSymbolInfo(unsignedShift).Symbol.ToTestDisplayString()); 2514Assert.Equal("C1 C1.op_UnsignedRightShift(C1 x, System.Int32 y)", model.GetSymbolInfo(unsignedShift).Symbol.ToTestDisplayString()); 2611Assert.Equal("C1 C1.op_UnsignedRightShift(C1 x, System.Int32 y)", model.GetSymbolInfo(unsignedShift).Symbol.ToTestDisplayString());
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
CompilationTestUtils.cs (2)
287summary.Symbol = symbolInfo.Symbol; 329summary.Symbol = symbolInfo.Symbol;
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinRTCollectionTests.cs (1)
7424var addMethod = model.GetSymbolInfo(add).Symbol;
Microsoft.CodeAnalysis.CSharp.Workspaces (60)
CastSimplifier.cs (8)
991if (oldSymbolInfo.Symbol != null) 996if (newSymbolInfo.Symbol is null) 1022var oldSymbolInfo = originalSemanticModel.GetSymbolInfo(currentOld, cancellationToken).Symbol; 1023var newSymbolInfo = rewrittenSemanticModel.GetSymbolInfo(currentNew, cancellationToken).Symbol; 1075var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1080var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol; 1184var originalMemberSymbol = originalSemanticModel.GetSymbolInfo(memberAccessExpression, cancellationToken).Symbol; 1189var rewrittenMemberSymbol = rewrittenSemanticModel.GetSymbolInfo(rewrittenMemberAccessExpression, cancellationToken).Symbol;
Classification\SyntaxClassification\DiscardSyntaxClassifier.cs (1)
50if (symbolInfo.Symbol?.Kind == SymbolKind.Discard)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
321symbolInfo.Symbol == null) 340symbolInfo.Symbol.IsImplicitValueParameter())
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.cs (1)
32if (symbolInfo.Symbol is IMethodSymbol methodSymbol
Classification\SyntaxClassification\UsingDirectiveSyntaxClassifier.cs (2)
45if (symbolInfo.Symbol is ITypeSymbol typeSymbol) 53else if (symbolInfo.Symbol?.Kind == SymbolKind.Namespace)
CSharpSemanticFacts.cs (2)
325var hasCastInfo = queryInfo.CastInfo.Symbol != null; 326var hasOperationInfo = queryInfo.OperationInfo.Symbol != null;
CSharpTypeInferenceService.TypeInferrer.cs (3)
475if (info.Symbol == null || 476argumentOpt == null && info.Symbol is IMethodSymbol method && method.Parameters.All(p => p.IsOptional || p.IsParams)) 1863SemanticModel.GetSymbolInfo(identifierName.Identifier).Symbol?.Kind == SymbolKind.Parameter)
CSharpUseImplicitTypeHelper.cs (2)
100var conflict = semanticModel.GetSpeculativeSymbolInfo(typeName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol; 305if (semanticModel.GetSymbolInfo(n, cancellationToken).Symbol.IsKind(SymbolKind.Local) == true)
Editing\CSharpImportAdder.cs (2)
57var symbol = model.GetSymbolInfo(fullName).Symbol; 58if (symbol != null && symbol.Kind != SymbolKind.Namespace && model.GetSymbolInfo(namespacePart).Symbol is INamespaceSymbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (1)
369var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
2509if (semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol is ITypeSymbol type && !type.CanSupportCollectionInitializer(containingSymbol)) 2799return semanticModelOpt.GetSymbolInfo(parentExpression, cancellationToken).Symbol == null;
ParenthesizedExpressionSyntaxExtensions.cs (1)
311var exprSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
Recommendations\CSharpRecommendationServiceRunner.cs (1)
324if (nameBinding.Symbol is not INamespaceOrTypeSymbol symbol)
Rename\CSharpRenameRewriterLanguageService.cs (3)
475if (symbolInfo.Symbol == null) 481symbols = SpecializedCollections.SingletonEnumerable(symbolInfo.Symbol); 549var symbol = _speculativeModel.GetSymbolInfo(token.Parent, _cancellationToken).Symbol;
SemanticModelExtensions.cs (6)
119else if (symbolInfo.Symbol != null) 121symbol = symbolInfo.Symbol as INamespaceOrTypeSymbol; 172if (symbolInfo.Symbol != null && symbolInfo.Symbol.Kind == SymbolKind.Namespace) 175result.Add((INamespaceSymbol)symbolInfo.Symbol); 437if (semanticModel.GetSymbolInfo(argumentList.Parent, cancellationToken).Symbol is IMethodSymbol member && index < member.Parameters.Length)
Simplification\CSharpSimplificationService.Expander.cs (7)
118var returnType = (_semanticModel.GetSymbolInfo(lambdaExpression).Symbol as IMethodSymbol)?.ReturnType; 140var returnType = (_semanticModel.GetSymbolInfo(parentLambda).Symbol as IMethodSymbol)?.ReturnType; 546var symbol = _semanticModel.GetSymbolInfo(originalSimpleName.Identifier).Symbol; 775var symbol = _semanticModel.GetSymbolInfo(typeArgument).Symbol; 1044if (_semanticModel.GetSymbolInfo(originalNode).Symbol.IsLocalFunction()) 1081if (binding.Symbol != null) 1102var newContainingType = _semanticModel.GetSpeculativeSymbolInfo(speculationPosition, containingTypeSyntax, SpeculativeBindingOption.BindAsExpression).Symbol;
Simplification\Reducers\CSharpExtensionMethodReducer.cs (5)
58if (targetSymbol.Symbol != null && targetSymbol.Symbol.Kind == SymbolKind.Method) 60var targetMethodSymbol = (IMethodSymbol)targetSymbol.Symbol; 115var oldSymbol = semanticModel.GetSymbolInfo(node).Symbol; 119SpeculativeBindingOption.BindAsExpression).Symbol;
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
291if (symbolInfo.Symbol is not INamespaceOrTypeSymbol)
Simplification\Simplifiers\NameSimplifier.cs (2)
259var typeSymbol = semanticModel.GetSymbolInfo(name, cancellationToken).Symbol; 697var symbol = model.GetSymbolInfo(name).Symbol as INamedTypeSymbol;
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (3)
44var symbol = symbolInfo.Symbol; 84var oldSymbol = semanticModel.GetSymbolInfo(crefSyntax, cancellationToken).Symbol; 91var newSymbol = semanticModel.GetSpeculativeSymbolInfo(crefSyntax.SpanStart, replacement, speculativeBindingOption).Symbol;
SpeculationAnalyzer.cs (4)
555var originalSymbol = this.OriginalSemanticModel.GetSymbolInfo(ctorInitializer, CancellationToken).Symbol; 556var newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newCtorInitializer, CancellationToken).Symbol; 562var originalSymbol = this.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol; 563var newSymbol = this.SpeculativeSemanticModel.GetCollectionInitializerSymbolInfo(newInitializer, CancellationToken).Symbol;
TypeStyleHelper.cs (1)
104if (semanticModel.GetSymbolInfo(memberName, cancellationToken).Symbol is not IMethodSymbol methodSymbol)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
50var symbol = model.GetSymbolInfo(o).Symbol;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
328var symbol = semanticModel.GetSymbolInfo(syntaxRoot.FindNode(testDocument.SelectedSpans.Single())).Symbol;
Utilities\SymbolEquivalenceComparerTests.cs (1)
1768return info.Symbol as IMethodSymbol;
Microsoft.CodeAnalysis.Features (54)
AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
105=> semanticModel.GetSymbolInfo(node, cancellationToken).Symbol as IMethodSymbol ??
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
547var symbol = lazyModel.GetSymbolInfo(node, cancellationToken).Symbol?.OriginalDefinition;
AbstractUnsealClassCodeFixProvider.cs (1)
39if (semanticModel.GetSymbolInfo(node, cancellationToken).Symbol is INamedTypeSymbol type &&
AbstractUseAutoPropertyAnalyzer.cs (1)
281return symbolInfo.Symbol is IFieldSymbol { DeclaringSyntaxReferences.Length: 1 } field
AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
101var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
303var symbol = semanticModel.GetSymbolInfo(invocation, cancellationToken).Symbol;
AbstractValidateFormatStringDiagnosticAnalyzer.cs (5)
282if (symbolInfo.Symbol == null) 287if (symbolInfo.Symbol.Kind != SymbolKind.Method) 292if (((IMethodSymbol)symbolInfo.Symbol).MethodKind == MethodKind.LocalFunction) 297var containingType = symbolInfo.Symbol.ContainingType; 308return (IMethodSymbol)symbolInfo.Symbol;
AddImport\SymbolReferenceFinder.cs (1)
591return symbolInfo.Symbol != null;
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
104.Where(e => state.SemanticModel.GetSymbolInfo(e, cancellationToken).Symbol?.OriginalDefinition == methodSymbol);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
249return semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol is IMethodSymbol method &&
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
78if (info.Symbol == null && info.CandidateSymbols.Length == 0)
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
129var method = symbolInfo.Symbol;
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
301var symbol = semanticModel.GetSymbolInfo(left, cancellationToken).Symbol;
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (1)
122var method = symbolInfo.Symbol;
ExtractMethod\Extensions.cs (2)
45if (info.Symbol == null) 50var methodSymbol = info.Symbol as IMethodSymbol;
FindUsages\AbstractFindUsagesService_FindReferences.cs (1)
204var symbol = semanticModel.GetSymbolInfo(token.Parent, cancellationToken).Symbol ?? semanticModel.GetDeclaredSymbol(token.Parent, cancellationToken);
Fixer.cs (3)
51if (symbolInfo.Symbol != null) // BC42016: the only candidate symbol is symbolInfo.Symbol 53candidateSymbols.Add(symbolInfo.Symbol); 214return symbolInfo.Symbol != null;
GenerateMember\AbstractGenerateMemberService.cs (3)
193isStatic = semanticInfo.Symbol is INamedTypeSymbol; 194isColorColorCase = typeInfo.Type != null && semanticInfo.Symbol != null && semanticInfo.Symbol.Name == typeInfo.Type.Name;
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
304if (semanticInfo.Symbol == null) 321if (semanticInfo.Symbol == null)
GenerateMember\GenerateEnumMember\AbstractGenerateEnumMemberService.State.cs (1)
111if (semanticInfo.Symbol != null)
GenerateMember\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (2)
208if (semanticInfo.Symbol != null && !service.IsValidSymbol(semanticInfo.Symbol, semanticModel))
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (2)
281if (semanticInfo.Symbol != null) 384var symbol = _document.SemanticModel.GetSymbolInfo(left, cancellationToken).Symbol;
GenerateType\AbstractGenerateTypeService.State.cs (3)
127if (info.Symbol != null) 386if (leftSideInfo.Symbol != null) 388var symbol = leftSideInfo.Symbol;
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
588return semanticModel.GetSymbolInfo(node, cancellationToken).Symbol;
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (2)
75var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol; 196var symbol = semanticModel.GetSymbolInfo(variable, cancellationToken).Symbol;
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
87var symbol = semanticModel.GetSymbolInfo(variable, cancellationToken).Symbol;
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (1)
360localVariable.Equals(semanticModel.GetSymbolInfo(node, cancellationToken).Symbol));
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
59if (semanticModel.GetSymbolInfo(node, cancellationToken).Symbol is ITypeSymbol typeSymbol)
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
89if (semanticModel.GetSymbolInfo(typeNode, cancellationToken).Symbol is not ITypeSymbol typeSymbol ||
QuickInfo\CommonSemanticQuickInfoProvider.cs (2)
235var symbol = semanticModel.GetSymbolInfo(lambdaSyntax, cancellationToken).Symbol; 241var symbol = semanticModel.GetSymbolInfo(elementAccessExpression, cancellationToken).Symbol;
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
83if (symbolInfo.Symbol == null)
UseCompoundAssignmentUtilities.cs (2)
104symbolInfo.Symbol == null) 110var symbol = symbolInfo.Symbol;
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
60var symbol = semanticModel.GetSymbolInfo(receiver, cancellationToken).Symbol;
ValueTracking\ValueTracker.cs (2)
263semanticModel.GetSymbolInfo(selectedNode, cancellationToken).Symbol 278selectedSymbol = semanticModel.GetSymbolInfo(selectedNode, cancellationToken).Symbol;
ValueTracking\ValueTracker.OperationCollector.cs (2)
85if (symbolInfo.Symbol is null) 90await AddOperationAsync(operation, symbolInfo.Symbol, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (3)
Generator.cs (3)
319if (symbolInfo.Symbol != null && IncludeSymbolInReferences(symbolInfo.Symbol)) 321referencedSymbol = symbolInfo.Symbol;
Microsoft.CodeAnalysis.VisualBasic (5)
Compilation\SemanticModel.vb (3)
502Return TryCast(info.Symbol, IAliasSymbol) 530Return TryCast(info.Symbol, IAliasSymbol) 2426Return TryCast(GetSymbolInfo(tupleTypeSyntax, cancellationToken).Symbol, TupleTypeSymbol)?.TupleElements.ElementAtOrDefault(tupleTypeSyntax.Elements.IndexOf(elementSyntax))
Compilation\SyntaxTreeSemanticModel.vb (2)
658If parentInfo.Symbol IsNot Nothing Then 659If Not Binder.AddReceiverNamespaces(namespaces, DirectCast(parentInfo.Symbol, Symbol), Compilation) Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (15)
ExpressionSyntaxExtensions.vb (1)
395Dim method = TryCast(semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol, IMethodSymbol)
InvocationExpressionSyntaxExtensions.vb (1)
49Dim symbol As ISymbol = semanticModel.GetSymbolInfo(invocationExpression.Expression).Symbol
ParenthesizedExpressionSyntaxExtensions.vb (1)
281Dim symbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol
SemanticModelExtensions.vb (4)
60ElseIf symbolInfo.Symbol IsNot Nothing Then 61symbol = TryCast(symbolInfo.Symbol, INamespaceOrTypeSymbol) 88Let ns = TryCast(info.Symbol, INamespaceSymbol) 253Dim member = TryCast(semanticModel.GetSymbolInfo(argumentList.Parent, cancellationToken).Symbol, IMethodSymbol)
SpeculationAnalyzer.vb (2)
439Dim originalSymbol = Me.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol 440Dim newSymbol = Me.SpeculativeSemanticModel.GetCollectionInitializerSymbolInfo(newInitializer, CancellationToken).Symbol
VariableDeclaratorSyntaxExtensions.vb (1)
33Return TryCast(semanticModel.GetSymbolInfo(asNewType).Symbol, ITypeSymbol)
VisualBasicUnnecessaryImportsProvider.vb (3)
117Dim namespaceOrType = TryCast(semanticInfo.Symbol, INamespaceOrTypeSymbol) 125aliasSymbol.Target.Equals(semanticInfo.Symbol) AndAlso 140Dim namespaceOrType = TryCast(semanticInfo.Symbol, INamespaceOrTypeSymbol)
VisualBasicUseAutoPropertyAnalyzer.vb (2)
121Dim symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).Symbol 159Dim field = TryCast(semanticModel.GetSymbolInfo(node, cancellationToken).Symbol, IFieldSymbol)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (6)
SyntaxTreeExtensions.vb (1)
326Dim objectCreationType = TryCast(symbolInfo.Symbol, ITypeSymbol)
VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
32Dim symbolType = semanticModel.GetSymbolInfo(type, cancellationToken).Symbol.GetSymbolType()
VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (1)
58Dim methodSymbol = TryCast(semanticModel.GetSymbolInfo(oldNode, cancellationToken).Symbol, IMethodSymbol)
VisualBasicSyntaxContextExtensions.vb (1)
123Dim objectCreationType = TryCast(symbolInfo.Symbol, ITypeSymbol)
VisualBasicTypeInferenceService.TypeInferrer.vb (2)
294Dim namedType = TryCast(info.Symbol, INamedTypeSymbol) 986SemanticModel.GetSymbolInfo(identifier.Identifier).Symbol?.Kind = SymbolKind.Parameter Then
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (2)
SymbolId\SymbolKeyTestBase.vb (2)
54Dim symbol = syminfo.Symbol 329list.Add(sinfo.Symbol)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (33)
CodeGen\CodeGenEvents.vb (6)
459Assert.Equal("Event Program.E As Program.del1", model.GetSymbolInfo(add.EventExpression).Symbol.ToTestDisplayString()) 481Assert.Equal("Event Program.E As Program.del1", model.GetSymbolInfo(remove.EventExpression).Symbol.ToTestDisplayString()) 501Assert.Equal("Event Program.E As Program.del1", model.GetSymbolInfo(raise.Name).Symbol.ToTestDisplayString()) 589Assert.Equal("Event Program.E As Program.del1", model.GetSymbolInfo(add.EventExpression).Symbol.ToTestDisplayString()) 611Assert.Equal("Event Program.E As Program.del1", model.GetSymbolInfo(remove.EventExpression).Symbol.ToTestDisplayString()) 631Assert.Equal("Event Program.E As Program.del1", model.GetSymbolInfo(raise.Name).Symbol.ToTestDisplayString())
CodeGen\CodeGenScriptTests.vb (1)
34Dim type = TryCast(info.Symbol, TypeSymbol)
CodeGen\CodeGenTuples.vb (25)
9012Assert.NotNull(model.GetSymbolInfo(type).Symbol) 9013Assert.Equal("System.Int32", model.GetSymbolInfo(type).Symbol.ToTestDisplayString()) 9040Assert.Equal("Alice", sym.Symbol.Name) 9041Assert.Equal(SymbolKind.Field, sym.Symbol.Kind) ' Incorrectly returns Local 9042Assert.Equal(nc.Name.GetLocation(), sym.Symbol.Locations(0)) ' Incorrect location 14141model.GetSymbolInfo(test3).Symbol.ToTestDisplayString()) 16539Assert.Equal("Function Derived.M6() As (System.Int32, System.Int32)", model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()) 16543Assert.Equal("Function Base.M6() As (a As System.Int32, b As System.Int32)", model.GetSymbolInfo(invocation2).Symbol.ToTestDisplayString()) 18362Assert.Equal("Property Derived.P6 As (System.Int32, System.Int32)", model.GetSymbolInfo(propertyAccess).Symbol.ToTestDisplayString()) 18366Assert.Equal("Property Base.P6 As (a As System.Int32, b As System.Int32)", model.GetSymbolInfo(propertyAccess2).Symbol.ToTestDisplayString()) 18404Assert.Equal("Property Derived.P6 As (System.Int32, System.Int32)", model.GetSymbolInfo(propertyAccess).Symbol.ToTestDisplayString()) 18408Assert.Equal("Property Base.P6 As (a As System.Int32, b As System.Int32)", model.GetSymbolInfo(propertyAccess2).Symbol.ToTestDisplayString()) 19993DirectCast(invocation1.Symbol, MethodSymbol).ReturnType.ToTestDisplayString()) 19997DirectCast(invocation2.Symbol, MethodSymbol).ReturnType.ToTestDisplayString()) 20001DirectCast(invocation3.Symbol, MethodSymbol).ReturnType.ToTestDisplayString()) 20043DirectCast(invocation1.Symbol, MethodSymbol).ReturnType.ToTestDisplayString()) 20047DirectCast(invocation2.Symbol, MethodSymbol).ReturnType.ToTestDisplayString()) 20051DirectCast(invocation3.Symbol, MethodSymbol).ReturnType.ToTestDisplayString()) 20802Assert.Equal("(System.Int32, elem2 As System.Int32).elem2 As System.Int32", model.GetSymbolInfo(nodes(0)).Symbol.ToTestDisplayString()) 20805Assert.Equal("elem2 As System.Int32", model.GetSymbolInfo(nodes(1)).Symbol.ToTestDisplayString()) 20808Assert.Equal("(System.Int32, elem2 As System.Int32).elem2 As System.Int32", model.GetSymbolInfo(nodes(2)).Symbol.ToTestDisplayString()) 20811Assert.Equal("elem2 As System.Int32", model.GetSymbolInfo(nodes(3)).Symbol.ToTestDisplayString()) 20816Assert.Equal("(System.Int32, elem2 As System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 20821Assert.Same(symbolInfo.Symbol, typeInfo.Type) 22443Dim actSymbol = DirectCast(model.GetSymbolInfo(actSyntax).Symbol, IMethodSymbol)
CodeGen\WinRTCollectionTests.vb (1)
6363Dim addMethod = model.GetSymbolInfo(add).Symbol
Microsoft.CodeAnalysis.VisualBasic.Features (65)
AddImport\VisualBasicAddImportFeatureService.vb (1)
274Dim symbol = info.Symbol.GetOriginalUnreducedDefinition()
ChangeSignature\VisualBasicChangeSignatureService.vb (10)
130Dim typeSymbol = semanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol 138symbol = If(symbolInfo.Symbol, symbolInfo.CandidateSymbols.FirstOrDefault()) 337Dim delegateInvokeMethod = DirectCast(DirectCast(semanticModel.GetSymbolInfo(raiseEventStatement.Name, cancellationToken).Symbol, IEventSymbol).Type, INamedTypeSymbol).DelegateInvokeMethod 357Dim methodSymbol = TryCast(symbolInfo.Symbol, IMethodSymbol) 397Dim methodSymbol = TryCast(symbolInfo.Symbol, IMethodSymbol) 416Dim methodSymbol = TryCast(symbolInfo.Symbol, IMethodSymbol) 522If symbolInfo.Symbol Is Nothing Then 540Return IsParamsArrayExpandedHelper(symbolInfo.Symbol, argumentCount, lastArgumentIsNamed, semanticModel, lastArgumentExpression, cancellationToken) 709convertedType = semanticModel.GetSymbolInfo(u.Operand, cancellationToken).Symbol 717Dim nodeType = semanticModel.GetSymbolInfo(cast.AsClause.Type, cancellationToken).Symbol
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (4)
254Dim nameToGenerate = semanticModel.GetSymbolInfo(node, cancellationToken).Symbol 260Dim targetType = TryCast(Await SymbolFinder.FindSourceDefinitionAsync(semanticModel.GetSymbolInfo(node.Left, cancellationToken).Symbol, document.Project.Solution, cancellationToken).ConfigureAwait(False), INamedTypeSymbol) 323Dim symbol = semanticModel.GetSymbolInfo(handlesClauseItem, cancellationToken).Symbol 346Dim withEventsProperty = TryCast(semanticModel.GetSymbolInfo(handlesClauseItem.EventContainer, cancellationToken).Symbol, IPropertySymbol)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.ReferenceRewriter.vb (1)
44Return Equals(symbolInfo.Symbol, _localSymbol)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (1)
350Dim symbol = semanticModel.GetSymbolInfo(expression).Symbol
Completion\CompletionProviders\AwaitCompletionProvider.vb (1)
60Dim symbol = semanticModel.GetSymbolInfo(memberAccessExpression.WalkDownParentheses(), cancellationToken).Symbol
Completion\CompletionProviders\CrefCompletionProvider.vb (1)
177Dim leftSymbol = semanticModel.GetSymbolInfo(qualifiedName.Left, cancellationToken).Symbol
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (2)
132If symbolInfo.Symbol IsNot Nothing Then 133Dim type = TryCast(symbolInfo.Symbol, IPropertySymbol)?.Type
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (1)
166container = TryCast(leftHandBinding.Symbol, INamespaceOrTypeSymbol)
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (1)
95Dim symbol = TryCast(symbolInfo.Symbol, ITypeSymbol)
Completion\KeywordRecommenders\Expressions\BinaryOperatorKeywordRecommender.vb (1)
59Dim symbol = context.SemanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol
Completion\KeywordRecommenders\Expressions\FromKeywordRecommender.vb (1)
32Dim type = TryCast(context.SemanticModel.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol, ITypeSymbol)
Debugging\ProximityExpressionsGetter.vb (3)
75If info.Symbol Is Nothing Then 81If info.Symbol.Kind = SymbolKind.Local Then 82Dim statement = info.Symbol.Locations.First().FindToken(cancellationToken).GetAncestor(Of StatementSyntax)()
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (19)
274If(model.GetSymbolInfo(identifier, cancellationToken).Symbol?.Equals(localOrParameter), False) 1446Return MemberSignaturesEquivalent(oldInfo.Select1.Symbol, newInfo.Select1.Symbol) AndAlso 1447MemberSignaturesEquivalent(oldInfo.Select2.Symbol, newInfo.Select2.Symbol) 1452Return MemberSignaturesEquivalent(oldInfo.AsClauseConversion.Symbol, newInfo.AsClauseConversion.Symbol) AndAlso 1453MemberSignaturesEquivalent(oldInfo.SelectMany.Symbol, newInfo.SelectMany.Symbol) AndAlso 1454MemberSignaturesEquivalent(oldInfo.ToQueryableCollectionConversion.Symbol, newInfo.ToQueryableCollectionConversion.Symbol) 1459Return MemberSignaturesEquivalent(oldInfo.Symbol, newInfo.Symbol) 1464Return MemberSignaturesEquivalent(oldInfo.Symbol, newInfo.Symbol) 1470Return MemberSignaturesEquivalent(oldInfo.Symbol, newInfo.Symbol) 1484Return MemberSignaturesEquivalent(oldInfo.Symbol, newInfo.Symbol)
ExtractMethod\VisualBasicMethodExtractor.PostProcessor.vb (2)
64Dim type = TryCast(symbolInfo.Symbol, ITypeSymbol) 135Dim type = TryCast(symbolInfo.Symbol, ITypeSymbol)
ExtractMethod\VisualBasicMethodExtractor.vb (1)
106Dim currentType = TryCast(symbolInfo.Symbol, ITypeSymbol)
GenerateConstructor\VisualBasicGenerateConstructorService.vb (1)
183Dim methodSymbol = TryCast(semanticModel.GetSymbolInfo(expressionStatement.Expression, cancellationToken).Symbol, IMethodSymbol)
GenerateType\VisualBasicGenerateTypeService.vb (6)
137Dim leftSymbol = semanticModel.GetSymbolInfo(DirectCast(nameOrMemberAccessExpression, MemberAccessExpressionSyntax).Expression).Symbol 172Dim leftSymbol = semanticModel.GetSymbolInfo(parent.Left).Symbol 296generateTypeServiceStateOptions.DelegateCreationMethodSymbol = TryCast(semanticModel.GetSymbolInfo(simpleArgumentExpression, cancellationToken).Symbol, IMethodSymbol) 336Dim symbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol 436If enclosingNamespaceSymbol.Symbol IsNot Nothing Then 437Return (DirectCast(enclosingNamespaceSymbol.Symbol, INamespaceSymbol),
SignatureHelp\AttributeSignatureHelpProvider.vb (1)
88Dim selectedItem = TryGetSelectedIndex(accessibleConstructors, symbolInfo.Symbol)
SignatureHelp\InvocationExpressionSignatureHelpProvider.vb (2)
89Dim matchedMethodSymbol = TryCast(symbolInfo.Symbol, IMethodSymbol) 136Dim selectedItem = TryGetSelectedIndex(accessibleMembers, symbolInfo.Symbol)
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.NormalType.vb (1)
40Dim selectedItem = TryGetSelectedIndex(accessibleConstructors, currentConstructor.Symbol)
VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
32Dim symbolType = semanticModel.GetSymbolInfo(type, cancellationToken).Symbol.GetSymbolType()
VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (1)
58Dim methodSymbol = TryCast(semanticModel.GetSymbolInfo(oldNode, cancellationToken).Symbol, IMethodSymbol)
VisualBasicUseAutoPropertyAnalyzer.vb (2)
121Dim symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).Symbol 159Dim field = TryCast(semanticModel.GetSymbolInfo(node, cancellationToken).Symbol, IFieldSymbol)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (630)
Binding\Binder_Expressions_Tests.vb (26)
2812Assert.Equal("E", symbolInfo.Symbol.ToTestDisplayString()) 2813Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind) 2822Assert.Equal("e As E", symbolInfo.Symbol.ToTestDisplayString()) 2826Assert.Equal("E", symbolInfo.Symbol.ToTestDisplayString()) 2827Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind) 2858Assert.Equal("E", symbolInfo.Symbol.ToTestDisplayString()) 2859Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind) 2868Assert.Equal("e As E", symbolInfo.Symbol.ToTestDisplayString()) 2872Assert.Equal("E", symbolInfo.Symbol.ToTestDisplayString()) 2873Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind) 2904Assert.Equal("e As System.Object", symbolInfo.Symbol.ToTestDisplayString()) 2913Assert.Equal("e As System.Object", symbolInfo.Symbol.ToTestDisplayString()) 2917Assert.Equal("e As System.Object", symbolInfo.Symbol.ToTestDisplayString()) 2955Assert.Equal("e As ?", symbolInfo.Symbol.ToTestDisplayString()) 2964Assert.Equal("e As ?", symbolInfo.Symbol.ToTestDisplayString()) 2968Assert.Equal("e As ?", symbolInfo.Symbol.ToTestDisplayString()) 3010Dim symbol = model.GetSymbolInfo(node).Symbol 3056Dim symbol = model.GetSymbolInfo(node).Symbol 3102Dim symbol = model.GetSymbolInfo(node).Symbol 3151Dim symbol = model.GetSymbolInfo(node).Symbol 3205Dim symbol = model.GetSymbolInfo(node).Symbol 3253Dim symbol = model.GetSymbolInfo(node).Symbol 3297Dim symbol = model.GetSymbolInfo(node).Symbol 3350Dim symbol = model.GetSymbolInfo(node).Symbol 3396Dim symbol = model.GetSymbolInfo(node).Symbol 3440Dim symbol = model.GetSymbolInfo(node).Symbol
Binding\BindingCollectionInitializerTests.vb (10)
1796Assert.NotNull(symbolInfo.Symbol) 1797Assert.Equal("Sub X.Add(x As System.String)", symbolInfo.Symbol.ToTestDisplayString()) 1806Assert.NotNull(symbolInfo.Symbol) 1807Assert.Equal("Sub X.Add(x As System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 1847Assert.Null(symbolInfo.Symbol) 1892Assert.Null(symbolInfo.Symbol) 1928Assert.NotNull(symbolInfo.Symbol) 1929Assert.Equal("Sub X.Add(x As System.String, y As System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 1967Assert.Null(symbolInfo.Symbol) 2007Assert.Equal("System.Collections.Generic.List(Of System.String)", semanticModel.GetSymbolInfo(name).Symbol.ToTestDisplayString())
Binding\BindingErrorTests.vb (3)
18850Assert.Equal("Event M1.t As M1.test_x", model.GetSymbolInfo(add.EventExpression).Symbol.ToTestDisplayString()) 18873Assert.Equal("Event M1.t As M1.test_x", model.GetSymbolInfo(remove.EventExpression).Symbol.ToTestDisplayString()) 18889Assert.Equal("Event M1.t As M1.test_x", model.GetSymbolInfo(raise.Name).Symbol.ToTestDisplayString())
Binding\ImplicitVariableTests.vb (2)
1112Assert.NotNull(tupleSymbolInfo.Symbol) 1114Dim tupleSymbol = TryCast(tupleSymbolInfo.Symbol, LocalSymbol)
Binding\LookupTests.vb (38)
1620Dim ns = DirectCast(info.Symbol, NamespaceSymbol) 1670Dim ns = DirectCast(info.Symbol, NamespaceSymbol) 1730Dim ns2 = DirectCast(info2.Symbol, NamespaceSymbol) 1739Dim ns1 = DirectCast(info1.Symbol, NamespaceSymbol) 1928Assert.Null(info3.Symbol) 1937Assert.Null(info2.Symbol) 1945Assert.Null(info1.Symbol) 1961Assert.Null(info2.Symbol) 1969Assert.Null(info3.Symbol) 1978Assert.Null(info3.Symbol) 2098Assert.Equal("NS1.NS6.NS7.T1", info3.Symbol.ToTestDisplayString()) 2102Assert.Equal("Sub NS1.NS6.NS7.T1..ctor()", info12.Symbol.ToTestDisplayString()) 2106Assert.Equal("NS1.NS6.NS7", info2.Symbol.ToTestDisplayString()) 2107Assert.Equal(NamespaceKind.Module, DirectCast(info2.Symbol, NamespaceSymbol).NamespaceKind) 2112Assert.Equal("NS1.NS6", info1.Symbol.ToTestDisplayString()) 2113Assert.Equal(NamespaceKind.Module, DirectCast(info1.Symbol, NamespaceSymbol).NamespaceKind) 2240Assert.Null(info3.Symbol) 2248Assert.Null(info2.Symbol) 2255Assert.Null(info1.Symbol) 2354Assert.Null(info3.Symbol) 2361Assert.Equal("NS1.NS6.NS7", info2.Symbol.ToTestDisplayString()) 2362Assert.Equal(NamespaceKind.Module, DirectCast(info2.Symbol, NamespaceSymbol).NamespaceKind) 2367Assert.Equal("NS1.NS6", info1.Symbol.ToTestDisplayString()) 2368Assert.Equal(NamespaceKind.Module, DirectCast(info1.Symbol, NamespaceSymbol).NamespaceKind) 2457Assert.Equal("Sub NS1.NS6.NS7.T1.M1()", info3.Symbol.ToTestDisplayString()) 2462Assert.Equal("NS1.NS6.NS7", info2.Symbol.ToTestDisplayString()) 2463Assert.Equal(NamespaceKind.Module, DirectCast(info2.Symbol, NamespaceSymbol).NamespaceKind) 2468Assert.Equal("NS1.NS6", info1.Symbol.ToTestDisplayString()) 2469Assert.Equal(NamespaceKind.Module, DirectCast(info1.Symbol, NamespaceSymbol).NamespaceKind) 2598Assert.Null(info3.Symbol) 2606Assert.Null(info2.Symbol) 2613Assert.Null(info1.Symbol) 2731Assert.Equal("NS1.NS6.NS7.Module1.T1", info3.Symbol.ToTestDisplayString()) 2735Assert.Equal("Sub NS1.NS6.NS7.Module1.T1..ctor()", info12.Symbol.ToTestDisplayString()) 2739Assert.Equal("NS1.NS6.NS7", info2.Symbol.ToTestDisplayString()) 2740Assert.Equal(NamespaceKind.Module, DirectCast(info2.Symbol, NamespaceSymbol).NamespaceKind) 2745Assert.Equal("NS1.NS6", info1.Symbol.ToTestDisplayString()) 2746Assert.Equal(NamespaceKind.Module, DirectCast(info1.Symbol, NamespaceSymbol).NamespaceKind)
Binding\MethodBodyBindingTests.vb (2)
520Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 714Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString())
Compilation\CompilationAPITests.vb (1)
1923Dim Symbol = SemanticModel.GetSymbolInfo(expr).Symbol
Compilation\SemanticModelAPITests.vb (70)
74Assert.NotNull(syminfo.Symbol) 75Assert.Equal(SymbolKind.Local, syminfo.Symbol.Kind) 81Assert.NotNull(syminfo.Symbol) 82Assert.Equal(SymbolKind.Local, syminfo.Symbol.Kind) 200Dim argsym1 = semanticModel.GetSymbolInfo(args.First().Expression).Symbol 201Dim argsym2 = semanticModel.GetSymbolInfo(args.Last().Expression).Symbol 233Dim symbol1 = model1.GetSymbolInfo(statement.Label).Symbol 234Dim symbol2 = model2.GetSymbolInfo(statement.Label).Symbol 417Assert.NotNull(symbolInfo.Symbol) 420Assert.Equal("Sub System.ObsoleteAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()) 424Assert.Null(symbolInfo.Symbol) 433Assert.NotNull(symbolInfo.Symbol) 436Assert.Equal("Sub System.ObsoleteAttribute..ctor(message As System.String)", symbolInfo.Symbol.ToTestDisplayString()) 440Assert.Null(symbolInfo.Symbol) 447Assert.NotNull(symbolInfo.Symbol) 450Assert.Equal("Sub C.DAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()) 455Assert.NotNull(symbolInfo.Symbol) 458Assert.Equal("Sub System.ObsoleteAttribute..ctor(message As System.String)", symbolInfo.Symbol.ToTestDisplayString()) 463Assert.NotNull(symbolInfo.Symbol) 466Assert.Equal("Sub C.DAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()) 501Assert.NotNull(symbolInfo.Symbol) 502Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind) 503Assert.Equal("Sub C.Bar(Of T)(x As T)", symbolInfo.Symbol.ToTestDisplayString()) 510Assert.NotNull(speculativeSymbolInfo.Symbol) 511Assert.Equal(SymbolKind.Method, speculativeSymbolInfo.Symbol.Kind) 512Assert.Equal("Sub C.Bar(Of T)(x As T)", speculativeSymbolInfo.Symbol.ToTestDisplayString()) 514Assert.Null(speculativeSymbolInfo.Symbol) 541Dim oldSymbol = symbolInfo.Symbol 549Dim newSymbol = speculativeSymbolInfo.Symbol 787Assert.NotNull(argSymbolInfo.Symbol) 788Assert.Equal("z", argSymbolInfo.Symbol.Name) 789Assert.Equal(SymbolKind.Local, argSymbolInfo.Symbol.Kind) 794Assert.NotNull(argSymbolInfo.Symbol) 795Assert.Equal("y", argSymbolInfo.Symbol.Name) 796Assert.Equal(SymbolKind.Local, argSymbolInfo.Symbol.Kind) 1053Assert.NotNull(symbolInfo.Symbol) 1054Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind) 1055Assert.Equal("NewMethod", symbolInfo.Symbol.Name) 1093Assert.NotNull(symbolInfo.Symbol) 1094Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind) 1095Assert.Equal("NewMethod", symbolInfo.Symbol.Name) 1229Assert.NotNull(symbolInfo.Symbol) 1232Assert.Equal("Sub System.ObsoleteAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()) 1241Assert.Null(symbolInfo.Symbol) 1260Assert.NotNull(symbolInfo.Symbol) 1263Assert.Equal("Sub System.ObsoleteAttribute..ctor(message As System.String)", symbolInfo.Symbol.ToTestDisplayString()) 1283Assert.Null(symbolInfo.Symbol) 1295Assert.NotNull(symbolInfo.Symbol) 1298Assert.Equal("Sub C.DAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()) 1308Assert.NotNull(symbolInfo.Symbol) 1311Assert.Equal("Sub System.ObsoleteAttribute..ctor(message As System.String)", symbolInfo.Symbol.ToTestDisplayString()) 1332Assert.NotNull(symbolInfo.Symbol) 1335Assert.Equal("Sub C.DAttribute..ctor()", symbolInfo.Symbol.ToTestDisplayString()) 1344Assert.NotNull(symbolInfo.Symbol) 1347Assert.Equal("Sub System.ObsoleteAttribute..ctor(message As System.String)", symbolInfo.Symbol.ToTestDisplayString()) 1399Assert.NotNull(symbolInfo.Symbol) 1400Assert.Equal("Goo", symbolInfo.Symbol.Name) 1459Assert.NotNull(argSymbolInfo.Symbol) 1460Assert.Equal("z", argSymbolInfo.Symbol.Name) 1461Assert.Equal(SymbolKind.Local, argSymbolInfo.Symbol.Kind) 1467Assert.Null(argSymbolInfo.Symbol) 1633Dim param = speculativeModel.GetSymbolInfo(declStatement.Declarators(0).Initializer.Value).Symbol 1729Dim symbol = speculativeModel.GetSymbolInfo(speculatedTypeSyntax).Symbol 1744symbol = speculativeModel.GetSymbolInfo(right).Symbol 1908Dim symbol = model.GetSymbolInfo(implementsName).Symbol 1923symbol = speculativeModel.GetSymbolInfo(speculatedMemberName).Symbol 4002Assert.Null(info.Symbol) 4027Dim symbol = semanticModel.GetSymbolInfo(enode).Symbol 4068Dim getterSymbol = model.GetSymbolInfo(pInGetter).Symbol 4077Dim setterSymbol = model.GetSymbolInfo(pInSetter).Symbol
Compilation\SuppressAccessibilityChecksTests.vb (6)
59Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name) 74Assert.Equal("_num", semanticModel.GetSpeculativeSymbolInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Symbol.Name) 123Assert.Equal("_p", symbolInfo.Symbol.Name) 191Assert.Equal("M", semanticModel.GetSymbolInfo(invocation).Symbol.Name) 197Assert.Equal("InternalExtension", semanticModel.GetSpeculativeSymbolInfo(position, speculativeInvocation, SpeculativeBindingOption.BindAsExpression).Symbol.Name) 269Assert.Equal("_p", symbolSpeculation.Symbol.Name)
DeclaringSyntaxNodeTests.vb (1)
132Dim sym As MethodSymbol = TryCast(model.GetSymbolInfo(node).Symbol, MethodSymbol)
Semantics\AnonymousTypesTests.vb (8)
1513Assert.Equal("Public Overridable Sub Invoke(x As Object)", info.Symbol.ToDisplayString()) 1514Assert.Equal("Sub <generated method>(x As Object)", info.Symbol.ContainingSymbol.ToDisplayString()) 1516Assert.Same(associatedDelegate, info.Symbol.ContainingSymbol) 1558Assert.Equal("Public Overridable Overloads Sub Invoke(obj As Object)", info.Symbol.ToDisplayString()) 1559Assert.Equal("System.Action(Of Object)", info.Symbol.ContainingSymbol.ToDisplayString()) 1561Assert.NotSame(associatedDelegate, info.Symbol.ContainingSymbol) 1600Assert.Equal("Public Overridable Overloads Sub Invoke()", info.Symbol.ToDisplayString()) 1601Assert.Equal("System.Action", info.Symbol.ContainingSymbol.ToDisplayString())
Semantics\BinaryOperators.vb (14)
783Assert.Equal("Public Shared Overloads Operator =(d1 As System.MulticastDelegate, d2 As System.MulticastDelegate) As Boolean", symbolInfo.Symbol.ToDisplayString()) 1043If info1.Symbol IsNot Nothing OrElse info1.CandidateSymbols.Length = 0 Then 1053Dim symbol1 = DirectCast(info1.Symbol, MethodSymbol) 1054Dim symbol2 = semanticModel.GetSymbolInfo(node2).Symbol 1055Dim symbol3 = semanticModel.GetSymbolInfo(node3).Symbol 1056Dim symbol4 = semanticModel.GetSymbolInfo(node4).Symbol 1057Dim symbol5 = DirectCast(semanticModel.GetSymbolInfo(node5).Symbol, MethodSymbol) 1058Dim symbol6 = semanticModel.GetSymbolInfo(node6).Symbol 1059Dim symbol7 = semanticModel.GetSymbolInfo(node7).Symbol 1060Dim symbol8 = semanticModel.GetSymbolInfo(node8).Symbol 1278Dim otherSymbol = DirectCast(semanticModel.GetSymbolInfo(node1).Symbol, MethodSymbol) 1333Dim symbol = DirectCast(semanticModel.GetSymbolInfo(node).Symbol, MethodSymbol) 1343Dim symbol = DirectCast(semanticModel.GetSymbolInfo(node).Symbol, MethodSymbol) 1429Dim symbol = semanticModel.GetSymbolInfo(nodes(i)).Symbol
Semantics\CompoundAssignment.vb (5)
307Assert.Equal("x As System.String", symbolInfo.Symbol.ToTestDisplayString()) 320Assert.Equal("y As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 1034Assert.Equal("x As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 1048Assert.Equal("y As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 1062Assert.Null(symbolInfo.Symbol)
Semantics\ConditionalAccessTests.vb (29)
652Assert.Equal("ReadOnly Property S1.P1 As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 664Assert.Equal("ReadOnly Property S1.P1 As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 674Assert.Null(symbolInfo.Symbol) 685Assert.Equal("x As System.Nullable(Of S1)", symbolInfo.Symbol.ToTestDisplayString()) 1332Assert.Equal("Function System.Func(Of System.Int32, System.String).Invoke(arg As System.Int32) As System.String", symbolInfo.Symbol.ToTestDisplayString()) 1342Assert.Null(symbolInfo.Symbol) 1352Assert.Equal("x As System.Func(Of System.Int32, System.String)", symbolInfo.Symbol.ToTestDisplayString()) 1366Assert.Null(symbolInfo.Symbol) 1377Assert.Null(symbolInfo.Symbol) 1387Assert.Equal("x As System.String()", symbolInfo.Symbol.ToTestDisplayString()) 1401Assert.Equal("ReadOnly Property C1.P1(i As System.Int32) As System.String", symbolInfo.Symbol.ToTestDisplayString()) 1411Assert.Null(symbolInfo.Symbol) 1421Assert.Equal("x As C1", symbolInfo.Symbol.ToTestDisplayString()) 1498Assert.Null(symbolInfo.Symbol) 1510Assert.Equal("Property My.InternalXmlHelper.AttributeValue(source As System.Xml.Linq.XElement, name As System.Xml.Linq.XName) As System.String", symbolInfo.Symbol.ToTestDisplayString()) 1520Assert.Null(symbolInfo.Symbol) 1530Assert.Equal("x As System.Xml.Linq.XElement", symbolInfo.Symbol.ToTestDisplayString()) 1542Assert.Equal("Function System.Xml.Linq.XContainer.Elements(name As System.Xml.Linq.XName) As System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", symbolInfo.Symbol.ToTestDisplayString()) 1553Assert.Equal("Function System.Xml.Linq.XContainer.Elements(name As System.Xml.Linq.XName) As System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", symbolInfo.Symbol.ToTestDisplayString()) 1563Assert.Null(symbolInfo.Symbol) 1573Assert.Equal("x As System.Xml.Linq.XElement", symbolInfo.Symbol.ToTestDisplayString()) 1585Assert.Equal("Function System.Xml.Linq.XContainer.Descendants(name As System.Xml.Linq.XName) As System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", symbolInfo.Symbol.ToTestDisplayString()) 1596Assert.Equal("Function System.Xml.Linq.XContainer.Descendants(name As System.Xml.Linq.XName) As System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement)", symbolInfo.Symbol.ToTestDisplayString()) 1606Assert.Null(symbolInfo.Symbol) 1616Assert.Equal("x As System.Xml.Linq.XElement", symbolInfo.Symbol.ToTestDisplayString()) 9818Assert.Null(info.Symbol) 9904Assert.Null(info.Symbol) 9956Assert.Null(info.Symbol) 9960Assert.Null(info.Symbol)
Semantics\GetExtendedSemanticInfoTests.vb (14)
8865Assert.Null(symbolInfo.Symbol) 8887Assert.Null(symbolInfo.Symbol) 8909Assert.Null(symbolInfo.Symbol) 9167Assert.Null(symbolInfo.Symbol) 9188Assert.Null(symbolInfo.Symbol) 9231Assert.Null(symbolInfo.Symbol) 9252Assert.Equal("Sub X..ctor(x As System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 9295Assert.Null(symbolInfo.Symbol) 9316Assert.Null(symbolInfo.Symbol) 9360Assert.Null(symbolInfo.Symbol) 9381Assert.Null(symbolInfo.Symbol) 9421Assert.Null(symbolInfo.Symbol) 9441Assert.Null(symbolInfo.Symbol) 10347Assert.Null(symbolInfo.Symbol)
Semantics\GetSemanticInfoTests.vb (59)
1291Assert.Null(ySymbolInfo.Symbol) 1295Assert.Equal("x", xSymbolInfo.Symbol.Name) 1639Assert.Equal("A", symbolInfo.Symbol.Name) 1646Assert.Equal("B", symbolInfo.Symbol.Name) 1652Assert.Equal("C", symbolInfo.Symbol.Name) 1658Assert.Equal("C", symbolInfo.Symbol.Name) 1666Assert.Equal("B", symbolInfo.Symbol.Name) 1672Assert.Equal("B", symbolInfo.Symbol.Name) 1680Assert.Equal("B", symbolInfo.Symbol.Name) 1686Assert.Equal("ToString", symbolInfo.Symbol.Name) 1693Assert.Equal("F", symbolInfo.Symbol.Name) 1700Assert.Equal("P1", symbolInfo.Symbol.Name) 1707Assert.Equal("P2", symbolInfo.Symbol.Name) 1714Assert.Equal("P3", symbolInfo.Symbol.Name) 1721Assert.Equal("F1", symbolInfo.Symbol.Name) 1728Assert.Equal("F2", symbolInfo.Symbol.Name) 1735Assert.Equal("C", symbolInfo.Symbol.Name) 1741Assert.Equal("Function C1.B() As System.Byte", symbolInfo.Symbol.ToTestDisplayString()) 1748Assert.Equal("Function C1.B() As System.Byte", symbolInfo.Symbol.ToTestDisplayString()) 1755Assert.Equal("Function C1.B() As System.Byte", symbolInfo.Symbol.ToTestDisplayString()) 1803Assert.Equal("Sub Module1.Func([i As System.Int32 = 0])", symbolInfo.Symbol.ToTestDisplayString()) 1807Assert.Equal("Sub Module1.f0(Of System.Object)([x As System.Object = Nothing])", symbolInfo.Symbol.ToTestDisplayString()) 1811Assert.Equal("Sub Module1.f0(Of System.Int32)([x As System.Int32 = Nothing])", symbolInfo.Symbol.ToTestDisplayString()) 1815Assert.Equal("Sub Module1.f0(Of System.String)([x As System.String = Nothing])", symbolInfo.Symbol.ToTestDisplayString()) 1819Assert.Equal("Sub Module1.f0(Of Module1.S)([x As Module1.S = Nothing])", symbolInfo.Symbol.ToTestDisplayString()) 1823Assert.Equal("Sub Module1.f0(Of Module1.C)([x As Module1.C = Nothing])", symbolInfo.Symbol.ToTestDisplayString()) 2463Assert.Equal("Public Property Property1 As String", speculativeSymbolInfo.Symbol.ToDisplayString()) 2464Assert.Equal(SymbolKind.Property, speculativeSymbolInfo.Symbol.Kind) 2496Assert.Equal("Public WriteOnly Property Property1 As String", speculativeSymbolInfo.Symbol.ToDisplayString()) 2497Assert.Equal(SymbolKind.Property, speculativeSymbolInfo.Symbol.Kind) 4501Dim method1 = TryCast(info1.Symbol, MethodSymbol) 4526Dim method2 = TryCast(info2.Symbol, MethodSymbol) 4563Dim method1 = TryCast(info1.Symbol, MethodSymbol) 4573Dim method2 = TryCast(info2.Symbol, MethodSymbol) 5127Assert.Null(info.Symbol) 5173Assert.Equal(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals), methodInfo.Symbol) 5218Assert.Equal(classA.GetMember(Of PropertySymbol)("P"), propertyInfo.Symbol) 5350Assert.Equal("Test.C", symbolInfo.Symbol.ToTestDisplayString()) 5365Assert.Equal("Sub Test.C..ctor()", symbolInfo.Symbol.ToTestDisplayString()) 5439Assert.Equal("Test.I", symbolInfo.Symbol.ToTestDisplayString()) 5454Assert.Equal("Sub Test.CoClassI..ctor()", symbolInfo.Symbol.ToTestDisplayString()) 5544Assert.Equal("Test.I", symbolInfo.Symbol.ToTestDisplayString()) 5559Assert.Null(symbolInfo.Symbol) 5982Assert.Null(symbolInfo.Symbol) 6003Assert.Null(symbolInfo.Symbol) 6054Assert.Null(symbolInfo.Symbol) 6150Assert.Null(model.GetSymbolInfo(expr).Symbol) 6155Assert.Null(model.GetSymbolInfo(expr).Symbol) 6212Assert.Null(model.GetSymbolInfo(expr).Symbol) 6217Assert.Null(model.GetSymbolInfo(expr).Symbol) 6222Assert.Equal("Property C.P As System.Object", model.GetSymbolInfo(expr).Symbol.ToTestDisplayString()) 6252Assert.Null(model.GetSymbolInfo(expr).Symbol) 6282Assert.Null(model.GetSymbolInfo(expr).Symbol) 6312Assert.Null(model.GetSymbolInfo(expr).Symbol) 6350Assert.Null(model.GetSymbolInfo(expr).Symbol) 6446Assert.Equal("Property C2.ViewData As C1", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()) 6505Assert.Equal("Property C2.ViewData As C1", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()) 6566Assert.Equal("Function C2.ViewData() As C1", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()) 6628Assert.Equal("Function C2.ViewData() As C1", model.GetSymbolInfo(node).Symbol.ToTestDisplayString())
Semantics\InitOnlyMemberTests.vb (2)
5246Assert.False(DirectCast(model.GetSymbolInfo(lambda).Symbol, MethodSymbol).IsInitOnly) 5249Assert.False(DirectCast(model.GetSymbolInfo(invocation).Symbol, MethodSymbol).IsInitOnly)
Semantics\LambdaSemanticInfoTests.vb (8)
669Assert.NotNull(info.Symbol) 754Assert.Null(symbolInfo.Symbol) 780Assert.Null(symbolInfo.Symbol) 810Assert.Equal("Sub System.Collections.Generic.ICollection(Of C).Add(item As C)", symbolInfo.Symbol.ToTestDisplayString()) 849Assert.Equal("a As Program", symbolInfo.Symbol.ToTestDisplayString()) 888Assert.Equal("a As Program", symbolInfo.Symbol.ToTestDisplayString()) 924Assert.Equal("a As Program", symbolInfo.Symbol.ToTestDisplayString()) 960Assert.Equal("a As Program", symbolInfo.Symbol.ToTestDisplayString())
Semantics\MeMyBaseMyClassTests.vb (3)
569Assert.Equal(expectedSymbol, symbolInfo.Symbol) 571Assert.Equal(expectedSymbol, symbolInfo.Symbol) 573Dim methodActual = DirectCast(symbolInfo.Symbol, MethodSymbol)
Semantics\NameOfTests.vb (100)
65Assert.Null(symbolInfo.Symbol) 77Assert.Equal("System.Int32.MaxValue As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 89Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 102Assert.Null(symbolInfo.Symbol) 114Assert.Equal("System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 130Assert.Null(symbolInfo.Symbol) 142Assert.Null(symbolInfo.Symbol) 462Assert.Null(symbolInfo.Symbol) 474Assert.Equal("System", symbolInfo.Symbol.ToTestDisplayString()) 486Assert.Equal("Global", symbolInfo.Symbol.ToTestDisplayString()) 534Assert.Null(symbolInfo.Symbol) 546Assert.Null(symbolInfo.Symbol) 560Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", symbolInfo.Symbol.ToTestDisplayString()) 569Assert.Equal("C2(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 618Assert.Null(symbolInfo.Symbol) 670Assert.Null(symbolInfo.Symbol) 720Assert.Null(symbolInfo.Symbol) 773Assert.Null(symbolInfo.Symbol) 823Assert.Null(symbolInfo.Symbol) 873Assert.Null(symbolInfo.Symbol) 885Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", symbolInfo.Symbol.ToTestDisplayString()) 897Assert.Equal("C2(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 950Assert.Null(symbolInfo.Symbol) 962Assert.Null(symbolInfo.Symbol) 975Assert.Equal("C2(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 1063Assert.Null(symbolInfo.Symbol) 1075Assert.Null(symbolInfo.Symbol) 1088Assert.Equal("C2", symbolInfo.Symbol.ToTestDisplayString()) 1131Assert.Null(symbolInfo.Symbol) 1143Assert.Equal("System", symbolInfo.Symbol.ToTestDisplayString()) 1196Assert.Null(symbolInfo.Symbol) 1208Assert.Null(symbolInfo.Symbol) 1222Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", symbolInfo.Symbol.ToTestDisplayString()) 1231Assert.Equal("C2(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 1278Assert.Null(symbolInfo.Symbol) 1290Assert.Null(symbolInfo.Symbol) 1304Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", symbolInfo.Symbol.ToTestDisplayString()) 1313Assert.Equal("C2(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 1360Assert.Null(symbolInfo.Symbol) 1372Assert.Null(symbolInfo.Symbol) 1385Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", symbolInfo.Symbol.ToTestDisplayString()) 1394Assert.Equal("C2(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 1441Assert.Null(symbolInfo.Symbol) 1453Assert.Null(symbolInfo.Symbol) 1466Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", symbolInfo.Symbol.ToTestDisplayString()) 1475Assert.Equal("C2(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 1521Assert.Null(symbolInfo.Symbol) 1533Assert.Null(symbolInfo.Symbol) 1546Assert.Equal("C2(Of System.Int32).C3(Of System.Int16)", symbolInfo.Symbol.ToTestDisplayString()) 1555Assert.Equal("C2(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 1652Assert.Null(symbolInfo.Symbol) 1664Assert.Null(symbolInfo.Symbol) 1745Assert.Null(symbolInfo.Symbol) 1757Assert.Equal("local As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 1802Assert.Null(symbolInfo.Symbol) 1814Assert.Equal("local As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 1859Assert.Null(symbolInfo.Symbol) 1871Assert.Equal("local As System.String", symbolInfo.Symbol.ToTestDisplayString()) 1916Assert.Null(symbolInfo.Symbol) 1928Assert.Equal("LOCAL As System.Object", symbolInfo.Symbol.ToTestDisplayString()) 2058Assert.Null(symbolInfo.Symbol) 2070Assert.Equal("C2.F1 As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 2083Assert.Equal("C2", symbolInfo.Symbol.ToTestDisplayString()) 2157Assert.Null(symbolInfo.Symbol) 2169Assert.Null(symbolInfo.Symbol) 2182Assert.Equal("C2", symbolInfo.Symbol.ToTestDisplayString()) 2258Assert.Null(symbolInfo.Symbol) 2270Assert.Null(symbolInfo.Symbol) 2283Assert.Equal("C2", symbolInfo.Symbol.ToTestDisplayString()) 2364Assert.Null(symbolInfo.Symbol) 2376Assert.Null(symbolInfo.Symbol) 2389Assert.Equal("C2", symbolInfo.Symbol.ToTestDisplayString()) 2468Assert.Null(symbolInfo.Symbol) 2480Assert.Equal("Event C2.E1 As System.Action", symbolInfo.Symbol.ToTestDisplayString()) 2493Assert.Equal("C2", symbolInfo.Symbol.ToTestDisplayString()) 2801Assert.Null(symbolInfo.Symbol) 2813Assert.Null(symbolInfo.Symbol) 2826Assert.Equal("Test", symbolInfo.Symbol.ToTestDisplayString()) 2876Assert.Null(symbolInfo.Symbol) 2888Assert.Null(symbolInfo.Symbol) 2941Assert.Null(symbolInfo.Symbol) 2953Assert.Null(symbolInfo.Symbol) 3003Assert.Null(symbolInfo.Symbol) 3015Assert.Null(symbolInfo.Symbol) 3064Assert.Null(symbolInfo.Symbol) 3076Assert.Null(symbolInfo.Symbol) 3125Assert.Null(symbolInfo.Symbol) 3137Assert.Equal("Module1.MTest As System.String", symbolInfo.Symbol.ToTestDisplayString()) 3185Assert.Null(symbolInfo.Symbol) 3197Assert.Equal("Event Module1.MTest As System.Action", symbolInfo.Symbol.ToTestDisplayString()) 3249Assert.Null(symbolInfo.Symbol) 3261Assert.Null(symbolInfo.Symbol) 3310Assert.Null(symbolInfo.Symbol) 3322Assert.Equal("Module1.F1 As System.Int32", symbolInfo.Symbol.ToTestDisplayString()) 3367Assert.Null(symbolInfo.Symbol) 3379Assert.Equal("Event Module1.F1 As System.Action", symbolInfo.Symbol.ToTestDisplayString()) 3425Assert.Null(symbolInfo.Symbol) 3437Assert.Null(symbolInfo.Symbol) 3481Assert.Null(symbolInfo.Symbol) 3493Assert.Null(symbolInfo.Symbol)
Semantics\NonTrailingNamedArgumentsTests.vb (21)
68model.GetSymbolInfo(firstInvocation).Symbol.ToTestDisplayString()) 73Assert.Equal(SymbolKind.Parameter, firstASymbol.Symbol.Kind) 74Assert.Equal("a", firstASymbol.Symbol.Name) 75Assert.Equal("Sub C.M(a As System.Int32, b As System.Int32)", firstASymbol.Symbol.ContainingSymbol.ToTestDisplayString()) 80model.GetSymbolInfo(secondInvocation).Symbol.ToTestDisplayString()) 85Assert.Equal(SymbolKind.Parameter, secondASymbol.Symbol.Kind) 86Assert.Equal("a", secondASymbol.Symbol.Name) 87Assert.Equal("Sub C.M(b As System.Int64, a As System.Int64)", secondASymbol.Symbol.ContainingSymbol.ToTestDisplayString()) 374Assert.Null(model.GetSymbolInfo(invocation).Symbol) 406Assert.Null(model.GetSymbolInfo(invocation).Symbol) 498Assert.Null(model.GetSymbolInfo(invocation).Symbol) 531Assert.Null(model.GetSymbolInfo(invocation).Symbol) 562Assert.Null(model.GetSymbolInfo(invocation).Symbol) 596Assert.Null(model.GetSymbolInfo(invocation).Symbol) 626Assert.Null(model.GetSymbolInfo(invocation).Symbol) 683Assert.Null(model.GetSymbolInfo(invocation).Symbol) 713Assert.Null(model.GetSymbolInfo(invocation).Symbol) 745Assert.Null(model.GetSymbolInfo(firstInvocation).Symbol) 779model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()) 810model.GetSymbolInfo(invocation).Symbol.ToTestDisplayString()) 946Assert.Null(model.GetSymbolInfo(invocation).Symbol)
Semantics\OverloadResolution.vb (6)
4325Assert.Null(symbolInfo.Symbol) 4335Assert.Null(symbolInfo.Symbol) 4346Assert.Null(symbolInfo.Symbol) 4434Assert.Null(symbolInfo.Symbol) 4444Assert.Null(symbolInfo.Symbol) 4455Assert.Null(symbolInfo.Symbol)
Semantics\QueryExpressions_SemanticModel.vb (102)
929Assert.Equal("Function QueryAble.Where(x As System.Func(Of System.Int32, System.Byte)) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 936Assert.Equal("Function QueryAble.TakeWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 943Assert.Equal("Function QueryAble.SkipWhile(x As System.Func(Of System.Int32, System.Boolean)) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 950Assert.Equal("Function QueryAble.Take(x As System.Int32) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 957Assert.Equal("Function QueryAble.Skip(x As System.Int32) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 1103Assert.Null(symbolInfo.Symbol) 1176Assert.Equal("Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 1182Assert.Same(symbolInfo.Symbol, commonSymbolInfo.Symbol) 1189Assert.Null(symbolInfo.Symbol) 1197Assert.Null(symbolInfo.Symbol) 1204Assert.Null(symbolInfo.Symbol) 1211Assert.Equal("Function QueryAble.Join(inner As QueryAble, outer As System.Func(Of System.Int32, System.Int32), inner As System.Func(Of System.Int32, System.Int32), x As System.Func(Of System.Int32, System.Int32, System.Int32)) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 1218Assert.Null(symbolInfo.Symbol) 1225Assert.Equal("Function QueryAble.Distinct() As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 1419Assert.Null(symbolInfo.Symbol) 1428Assert.Null(symbolInfo.Symbol) 1433Assert.Null(commonSymbolInfo.Symbol) 1479Assert.Equal("Function QueryAble.OrderBy(x As System.Func(Of System.Int32, System.Int32)) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 1484Assert.Same(symbolInfo.Symbol, commonSymbolInfo.Symbol) 1491Assert.Equal("Function QueryAble.ThenBy(x As System.Func(Of System.Int32, System.Int32)) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 1496Assert.Same(symbolInfo.Symbol, commonSymbolInfo.Symbol) 1681Assert.Null(symbolInfo.Symbol) 1699Assert.Null(symbolInfo.Symbol) 1706Assert.Null(symbolInfo.Symbol) 1711Assert.Null(commonSymbolInfo.Symbol) 1718Assert.Null(symbolInfo.Symbol) 1725Assert.Equal("Function QueryAble.Select(x As System.Func(Of System.Int32, System.Int32)) As QueryAble", symbolInfo.Symbol.ToTestDisplayString()) 1730Assert.Same(symbolInfo.Symbol, commonSymbolInfo.Symbol) 1785Assert.Equal("Function QueryAble(Of System.Int32).Select(Of <anonymous type: Key s As System.Int32, Key x As System.Int32>)(x As System.Func(Of System.Int32, <anonymous type: Key s As System.Int32, Key x As System.Int32>)) As QueryAble(Of <anonymous type: Key s As System.Int32, Key x As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 1792Assert.Equal("Function QueryAble(Of <anonymous type: Key s As System.Int32, Key x As System.Int32>).Select(Of <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key x As System.Int32>, Key y As System.Int32>)(x As System.Func(Of <anonymous type: Key s As System.Int32, Key x As System.Int32>, <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key x As System.Int32>, Key y As System.Int32>)) As QueryAble(Of <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key x As System.Int32>, Key y As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 1799Assert.Equal("Function QueryAble(Of <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key x As System.Int32>, Key y As System.Int32>).Select(Of <anonymous type: Key s As System.Int32, Key x As System.Int32, Key y As System.Int32, Key $861 As System.Int32>)(x As System.Func(Of <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key x As System.Int32>, Key y As System.Int32>, <anonymous type: Key s As System.Int32, Key x As System.Int32, Key y As System.Int32, Key $861 As System.Int32>)) As QueryAble(Of <anonymous type: Key s As System.Int32, Key x As System.Int32, Key y As System.Int32, Key $861 As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 1806Assert.Null(symbolInfo.Symbol) 1813Assert.Equal("Function QueryAble(Of <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>).Select(Of <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>, Key y As System.Int32>)(x As System.Func(Of <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>, <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>, Key y As System.Int32>)) As QueryAble(Of <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>, Key y As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 1820Assert.Equal("Function QueryAble(Of <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>, Key y As System.Int32>).Select(Of <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32, Key y As System.Int32, Key $1136 As System.Int32>)(x As System.Func(Of <anonymous type: Key $VB$It As <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>, Key y As System.Int32>, <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32, Key y As System.Int32, Key $1136 As System.Int32>)) As QueryAble(Of <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32, Key y As System.Int32, Key $1136 As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 1827Assert.Equal("Function QueryAble(Of System.Int32).Join(Of System.Int32, System.Int32, <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>)(inner As QueryAble(Of System.Int32), outerKey As System.Func(Of System.Int32, System.Int32), innerKey As System.Func(Of System.Int32, System.Int32), x As System.Func(Of System.Int32, System.Int32, <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>)) As QueryAble(Of <anonymous type: Key s As System.Int32, Key s2 As System.Int32, Key x As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 1855Assert.NotNull(symbolInfo.Symbol) 1856Assert.Equal("Public Overrides Function ToString() As String", symbolInfo.Symbol.ToDisplayString()) 1882Assert.NotNull(symbolInfo.Symbol) 1883Assert.Equal("Public Overloads ReadOnly Property Length As Integer", symbolInfo.Symbol.ToDisplayString()) 1909Assert.NotNull(symbolInfo.Symbol) 1910Assert.Equal("Public Overrides Function ToString() As String", symbolInfo.Symbol.ToDisplayString()) 1936Assert.NotNull(symbolInfo.Symbol) 1937Assert.Equal("Public Overloads ReadOnly Property Length As Integer", symbolInfo.Symbol.ToDisplayString()) 2201Assert.Null(symbolInfo.Symbol) 2208Assert.Null(symbolInfo.Symbol) 2215Assert.Equal("Function QueryAble(Of QueryAble(Of QueryAble(Of System.Int32))).Select(Of QueryAble(Of QueryAble(Of System.Int32)))(x As System.Func(Of QueryAble(Of QueryAble(Of System.Int32)), QueryAble(Of QueryAble(Of System.Int32)))) As QueryAble(Of QueryAble(Of QueryAble(Of System.Int32)))", symbolInfo.Symbol.ToTestDisplayString()) 2239Assert.Equal("Function QueryAble(Of QueryAble(Of QueryAble(Of System.Int32))).SelectMany(Of QueryAble(Of System.Int32), <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>)(m As System.Func(Of QueryAble(Of QueryAble(Of System.Int32)), QueryAble(Of QueryAble(Of System.Int32))), x As System.Func(Of QueryAble(Of QueryAble(Of System.Int32)), QueryAble(Of System.Int32), <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>)) As QueryAble(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>)", symbolInfo.Symbol.ToTestDisplayString()) 2259Assert.Equal("Function QueryAble(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>).SelectMany(Of System.Int32, <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s5 As System.Int32>)(m As System.Func(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>, QueryAble(Of System.Int32)), x As System.Func(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>, System.Int32, <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s5 As System.Int32>)) As QueryAble(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s5 As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 2284Assert.Equal("Function QueryAble(Of System.Int32).Select(Of System.Int64)(x As System.Func(Of System.Int32, System.Int64)) As QueryAble(Of System.Int64)", symbolInfo.Symbol.ToTestDisplayString()) 2300Assert.Equal("Function QueryAble(Of System.Int32).Select(Of System.Int64)(x As System.Func(Of System.Int32, System.Int64)) As QueryAble(Of System.Int64)", symbolInfo.Symbol.ToTestDisplayString()) 2305Assert.Equal("Function QueryAble(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>).SelectMany(Of System.Int64, <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s6 As System.Int64>)(m As System.Func(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>, QueryAble(Of System.Int64)), x As System.Func(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>, System.Int64, <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s6 As System.Int64>)) As QueryAble(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s6 As System.Int64>)", symbolInfo.Symbol.ToTestDisplayString()) 2317Assert.Equal("Function QueryAble2(Of System.Int32).AsQueryable() As QueryAble(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 2332Assert.Equal("Function QueryAble2(Of System.Int32).AsQueryable() As QueryAble(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 2339Assert.Equal("Function QueryAble(Of QueryAble2(Of System.Int32)).SelectMany(Of System.Int32, <anonymous type: Key s As QueryAble2(Of System.Int32), Key s8 As System.Int32>)(m As System.Func(Of QueryAble2(Of System.Int32), QueryAble(Of System.Int32)), x As System.Func(Of QueryAble2(Of System.Int32), System.Int32, <anonymous type: Key s As QueryAble2(Of System.Int32), Key s8 As System.Int32>)) As QueryAble(Of <anonymous type: Key s As QueryAble2(Of System.Int32), Key s8 As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 2351Assert.Equal("Function QueryAble3(Of System.Int32).AsEnumerable() As QueryAble(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 2366Assert.Equal("Function QueryAble2(Of System.Int32).AsQueryable() As QueryAble(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 2371Assert.Equal("Function QueryAble(Of System.Int32).Select(Of System.Int64)(x As System.Func(Of System.Int32, System.Int64)) As QueryAble(Of System.Int64)", symbolInfo.Symbol.ToTestDisplayString()) 2385Assert.Equal("Function QueryAble2(Of System.Int32).AsQueryable() As QueryAble(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 2392Assert.Equal("Function QueryAble(Of QueryAble2(Of System.Int32)).SelectMany(Of System.Int32, <anonymous type: Key s As QueryAble2(Of System.Int32), Key s11 As System.Int32>)(m As System.Func(Of QueryAble2(Of System.Int32), QueryAble(Of System.Int32)), x As System.Func(Of QueryAble2(Of System.Int32), System.Int32, <anonymous type: Key s As QueryAble2(Of System.Int32), Key s11 As System.Int32>)) As QueryAble(Of <anonymous type: Key s As QueryAble2(Of System.Int32), Key s11 As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 2404Assert.Equal("Function QueryAble2(Of System.Int32).AsQueryable() As QueryAble(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 2409Assert.Equal("Function QueryAble(Of System.Int32).Select(Of System.Int64)(x As System.Func(Of System.Int32, System.Int64)) As QueryAble(Of System.Int64)", symbolInfo.Symbol.ToTestDisplayString()) 2414Assert.Equal("Function QueryAble(Of QueryAble2(Of System.Int32)).SelectMany(Of System.Int64, <anonymous type: Key s As QueryAble2(Of System.Int32), Key s12 As System.Int64>)(m As System.Func(Of QueryAble2(Of System.Int32), QueryAble(Of System.Int64)), x As System.Func(Of QueryAble2(Of System.Int32), System.Int64, <anonymous type: Key s As QueryAble2(Of System.Int32), Key s12 As System.Int64>)) As QueryAble(Of <anonymous type: Key s As QueryAble2(Of System.Int32), Key s12 As System.Int64>)", symbolInfo.Symbol.ToTestDisplayString()) 2430Assert.Equal("Function QueryAble(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>).SelectMany(Of System.Int32, System.Int32)(m As System.Func(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>, QueryAble(Of System.Int32)), x As System.Func(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>, System.Int32, System.Int32)) As QueryAble(Of System.Int32)", symbolInfo.Symbol.ToTestDisplayString()) 2446Assert.Equal("Function QueryAble(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>).SelectMany(Of System.Int32, <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s14 As System.Int32, Key s15 As System.Int32>)(m As System.Func(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>, QueryAble(Of System.Int32)), x As System.Func(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32)>, System.Int32, <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s14 As System.Int32, Key s15 As System.Int32>)) As QueryAble(Of <anonymous type: Key s As QueryAble(Of QueryAble(Of System.Int32)), Key s2 As QueryAble(Of System.Int32), Key s14 As System.Int32, Key s15 As System.Int32>)", symbolInfo.Symbol.ToTestDisplayString()) 2458Assert.Equal("Function QueryAble5.Cast(Of System.Object)() As QueryAble4(Of System.Object)", symbolInfo.Symbol.ToTestDisplayString()) 2704Assert.Null(symbolInfo.Symbol) 2755Assert.Null(symbolInfo.Symbol) 2824Assert.Equal("Function QueryAble(Of System.Int32).GroupBy(Of System.Int32, <anonymous type: Key s As System.Int32, Key Group As QueryAble(Of System.Int32)>)(key As System.Func(Of System.Int32, System.Int32), into As System.Func(Of System.Int32, QueryAble(Of System.Int32), <anonymous type: Key s As System.Int32, Key Group As QueryAble(Of System.Int32)>)) As QueryAble(Of <anonymous type: Key s As System.Int32, Key Group As QueryAble(Of System.Int32)>)", symbolInfo.Symbol.ToTestDisplayString()) 2959Assert.Equal("Function QueryAble(Of System.Int32).GroupJoin(Of System.Byte, System.Int32, <anonymous type: Key s As System.Int32, Key Group As QueryAble(Of System.Byte)>)(inner As QueryAble(Of System.Byte), outerKey As System.Func(Of System.Int32, System.Int32), innerKey As System.Func(Of System.Byte, System.Int32), x As System.Func(Of System.Int32, QueryAble(Of System.Byte), <anonymous type: Key s As System.Int32, Key Group As QueryAble(Of System.Byte)>)) As QueryAble(Of <anonymous type: Key s As System.Int32, Key Group As QueryAble(Of System.Byte)>)", symbolInfo.Symbol.ToTestDisplayString()) 3379Assert.Equal("Function QueryAble(Of System.Int32).Select(Of System.Int32)(x As System.Func(Of System.Int32, System.Int32)) As QueryAble(Of System.Int32)", symbolInfo1.Symbol.ToTestDisplayString()) 3385Assert.Same(symbolInfo1.Symbol, symbolInfo2.Symbol) 3390Assert.Same(symbolInfo1.Symbol, commonSymbolInfo.Symbol) 3399Assert.Null(symbolInfo1.Symbol) 3406Assert.Same(symbolInfo1.Symbol, symbolInfo2.Symbol) 3412Assert.Null(symbolInfo1.Symbol) 3418Assert.Null(symbolInfo3.Select1.Symbol) 3420Assert.Null(symbolInfo3.Select2.Symbol) 3426Assert.Null(symbolInfo3.Select1.Symbol) 3428Assert.Null(symbolInfo3.Select2.Symbol) 3568Assert.Null(symbolInfo1.Symbol) 3577Assert.Equal("Function QueryAble(Of QueryAble(Of System.Int32)).Select(Of <anonymous type: Key s1 As QueryAble(Of System.Int32), Key Count As System.Int32>)(x As System.Func(Of QueryAble(Of System.Int32), <anonymous type: Key s1 As QueryAble(Of System.Int32), Key Count As System.Int32>)) As QueryAble(Of <anonymous type: Key s1 As QueryAble(Of System.Int32), Key Count As System.Int32>)", symbolInfo1.Symbol.ToTestDisplayString()) 3581Assert.Null(symbolInfo3.Select2.Symbol) 3588Assert.Null(symbolInfo1.Symbol) 3592Assert.Null(symbolInfo3.Select2.Symbol) 3599Assert.Equal("Function QueryAble(Of QueryAble(Of System.Int32)).Select(Of <anonymous type: Key s1 As QueryAble(Of System.Int32), Key $VB$Group As QueryAble(Of System.Int32)>)(x As System.Func(Of QueryAble(Of System.Int32), <anonymous type: Key s1 As QueryAble(Of System.Int32), Key $VB$Group As QueryAble(Of System.Int32)>)) As QueryAble(Of <anonymous type: Key s1 As QueryAble(Of System.Int32), Key $VB$Group As QueryAble(Of System.Int32)>)", symbolInfo1.Symbol.ToTestDisplayString()) 3604Assert.Equal("Function QueryAble(Of <anonymous type: Key s1 As QueryAble(Of System.Int32), Key $VB$Group As QueryAble(Of System.Int32)>).Select(Of <anonymous type: Key s1 As QueryAble(Of System.Int32), Key Count As System.Int32, Key Select As QueryAble(Of System.Int32)>)(x As System.Func(Of <anonymous type: Key s1 As QueryAble(Of System.Int32), Key $VB$Group As QueryAble(Of System.Int32)>, <anonymous type: Key s1 As QueryAble(Of System.Int32), Key Count As System.Int32, Key Select As QueryAble(Of System.Int32)>)) As QueryAble(Of <anonymous type: Key s1 As QueryAble(Of System.Int32), Key Count As System.Int32, Key Select As QueryAble(Of System.Int32)>)", symbolInfo1.Symbol.ToTestDisplayString()) 3612Assert.Null(symbolInfo1.Symbol) 3618Assert.Null(symbolInfo1.Symbol) 3750Assert.Null(symbolInfo.Symbol) 3755Assert.Null(symbolInfo.Symbol) 3763Assert.Null(symbolInfo.Symbol) 3768Assert.Equal("Function QueryAble(Of <anonymous type: Key i As System.Int32, Key b As System.Byte, Key $VB$Group As QueryAble(Of System.Int16)>).Select(Of <anonymous type: Key i As System.Int32, Key b As System.Byte, Key Where As QueryAble(Of System.Int16), Key Distinct As QueryAble(Of System.Int16)>)(x As System.Func(Of <anonymous type: Key i As System.Int32, Key b As System.Byte, Key $VB$Group As QueryAble(Of System.Int16)>, <anonymous type: Key i As System.Int32, Key b As System.Byte, Key Where As QueryAble(Of System.Int16), Key Distinct As QueryAble(Of System.Int16)>)) As QueryAble(Of <anonymous type: Key i As System.Int32, Key b As System.Byte, Key Where As QueryAble(Of System.Int16), Key Distinct As QueryAble(Of System.Int16)>)", symbolInfo.Symbol.ToTestDisplayString()) 3821Assert.Null(info.Symbol) 3857Assert.Null(aggrClauseSymInfo.Select1.Symbol) 3859Assert.Null(aggrClauseSymInfo.Select2.Symbol)
Semantics\ScriptSemanticsTests.vb (11)
48Assert.Null(semanticModel.GetSymbolInfo(node5.Name).Symbol) 63Assert.Null(semanticModel.GetSymbolInfo(node5.Name).Symbol) 79Assert.Equal("Sub System.Console.WriteLine(value As System.Int32)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()) 88Assert.Equal("Sub System.Console.WriteLine(value As System.Int32)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()) 97Assert.Equal("Sub System.Console.WriteLine(value As System.Int32)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()) 110Assert.Equal("Sub System.Console.WriteLine(value As System.Int32)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()) 123Assert.Equal("Sub System.Console.WriteLine(value As System.Int32)", semanticModel.GetSymbolInfo(node5.Name).Symbol.ToTestDisplayString()) 144Assert.Null(semanticModel1.GetSymbolInfo(node1.Name).Symbol) 145Assert.Equal("Sub System.Console.WriteLine(value As System.Int32)", semanticModel2.GetSymbolInfo(node2.Name).Symbol.ToTestDisplayString()) 158Assert.Null(semanticModel1.GetSymbolInfo(node1.Name).Symbol) 159Assert.Equal("Sub System.Console.WriteLine(value As System.Int32)", semanticModel2.GetSymbolInfo(node2.Name).Symbol.ToTestDisplayString())
Semantics\SelectCaseTests.vb (4)
736Assert.Equal("day As C.DayOfWeek", symbolInfo.Symbol.ToTestDisplayString()) 737Assert.Equal(SymbolKind.Parameter, symbolInfo.Symbol.Kind) 773Assert.Equal("day As C.DayOfWeek", symbolInfo.Symbol.ToTestDisplayString()) 774Assert.Equal(SymbolKind.Parameter, symbolInfo.Symbol.Kind)
Semantics\TypeOfTests.vb (14)
747Assert.Equal("System.String", semantics.GetSymbolInfo(typeOfExpressions(0).Type).Symbol.ToDisplayString(SymbolDisplayFormat.TestFormat)) 753Assert.Equal("System.Int32", semantics.GetSymbolInfo(typeOfExpressions(1).Type).Symbol.ToDisplayString(SymbolDisplayFormat.TestFormat)) 757Assert.Equal("System.String", semantics.GetSymbolInfo(typeOfExpressions(2).Type).Symbol.ToDisplayString(SymbolDisplayFormat.TestFormat)) 767Assert.Equal(SymbolKind.Local, symbolInfo.Symbol.Kind) 768Assert.Equal("isString", symbolInfo.Symbol.Name) 772Assert.DoesNotContain(symbolInfo.Symbol, expressionAnalysis.AlwaysAssigned) 773Assert.DoesNotContain(symbolInfo.Symbol, expressionAnalysis.Captured) 774Assert.Contains(symbolInfo.Symbol, expressionAnalysis.DataFlowsIn) 775Assert.DoesNotContain(symbolInfo.Symbol, expressionAnalysis.DataFlowsOut) 776Assert.Contains(symbolInfo.Symbol, expressionAnalysis.ReadInside) 777Assert.Contains(symbolInfo.Symbol, expressionAnalysis.ReadOutside) 779Assert.DoesNotContain(symbolInfo.Symbol, expressionAnalysis.VariablesDeclared) 780Assert.DoesNotContain(symbolInfo.Symbol, expressionAnalysis.WrittenInside) 781Assert.Contains(symbolInfo.Symbol, expressionAnalysis.WrittenOutside)
Semantics\UnaryOperators.vb (7)
705Dim symbol1 = DirectCast(info1.Symbol, MethodSymbol) 706Dim symbol2 = semanticModel.GetSymbolInfo(node2).Symbol 707Dim symbol3 = DirectCast(semanticModel.GetSymbolInfo(node3).Symbol, MethodSymbol) 708Dim symbol4 = semanticModel.GetSymbolInfo(node4).Symbol 788Dim otherSymbol = DirectCast(semanticModel.GetSymbolInfo(node1).Symbol, MethodSymbol) 822Dim symbol1 = DirectCast(semanticModel.GetSymbolInfo(node1).Symbol, MethodSymbol) 828Dim symbol2 = DirectCast(semanticModel.GetSymbolInfo(node1).Symbol, MethodSymbol)
Semantics\UserDefinedBinaryOperators.vb (13)
218Assert.Equal(baseLine(i), symbolInfo.Symbol.ToDisplayString()) 338Assert.Null(symbolInfo.Symbol) 403Assert.Null(symbolInfo.Symbol) 457Assert.Null(symbolInfo.Symbol) 522Assert.Null(symbolInfo.Symbol) 590Assert.Null(symbolInfo.Symbol) 1769Assert.Equal("Function Module1.S1(Of T).op_Addition(x As Module1.S1(Of T), y As System.Int32) As Module1.S1(Of T)", symbolInfo.Symbol.OriginalDefinition.ToTestDisplayString()) 2738Assert.NotNull(typeSymbolInfo.Symbol) 2739Dim typeSymbol = TryCast(typeSymbolInfo.Symbol, NamedTypeSymbol) 2777Assert.NotNull(typeSymbolInfo.Symbol) 2778Dim typeSymbol = TryCast(typeSymbolInfo.Symbol, NamedTypeSymbol) 2790Assert.NotNull(valueSymbolInfo.Symbol) 2791Dim valueSymbol = TryCast(valueSymbolInfo.Symbol, SourceMemberFieldSymbol)
Semantics\UserDefinedConversions.vb (3)
78Assert.Equal("Function Module1.B2.op_Implicit(x As System.Int32) As Module1.B2", symbolInfo.Symbol.ToTestDisplayString()) 3669Assert.Equal("x As Module1.S8", symbolInfo.Symbol.ToTestDisplayString()) 3734Assert.Equal("x As Module1.S8", symbolInfo.Symbol.ToTestDisplayString())
Semantics\UserDefinedUnaryOperators.vb (6)
59Assert.Equal("Function Module1.C1.op_OnesComplement(x As Module1.C1) As Module1.C1", symbolInfo.Symbol.ToTestDisplayString()) 60Assert.Equal("Public Shared Operator Not(x As Module1.C1) As Module1.C1", symbolInfo.Symbol.ToDisplayString()) 99Assert.Equal("Function Module1.C1.op_UnaryPlus(x As Module1.C1) As Module1.C1", symbolInfo.Symbol.ToTestDisplayString()) 100Assert.Equal("Public Shared Operator +(x As Module1.C1) As Module1.C1", symbolInfo.Symbol.ToDisplayString()) 139Assert.Equal("Function Module1.C1.op_UnaryNegation(x As Module1.C1) As Module1.C1", symbolInfo.Symbol.ToTestDisplayString()) 140Assert.Equal("Public Shared Operator -(x As Module1.C1) As Module1.C1", symbolInfo.Symbol.ToDisplayString())
Semantics\UsingStatementTest.vb (7)
344If (type.Symbol.Kind = SymbolKind.Method) Then 345If (DirectCast(type.Symbol, MethodSymbol).MethodKind = MethodKind.Constructor) Then 348Assert.Equal(symbols(i), type.Symbol.ContainingSymbol) 353Assert.Equal(symbols(i), DirectCast(type.Symbol, MethodSymbol).ReturnType) 357ElseIf (type.Symbol.Kind = SymbolKind.Field) Then 359Assert.Equal(symbols(i), DirectCast(type.Symbol, FieldSymbol).Type) 364Assert.Equal(symbols(i), type.Symbol)
Semantics\WithBlockSemanticModelTests.vb (33)
47Assert.Equal("Public Shared field1 As String", symbolInfo.Symbol.ToDisplayString()) 48Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind) 110Assert.Equal("Public Property Property2 As String", speculativeSymbolInfo.Symbol.ToDisplayString()) 111Assert.Equal(SymbolKind.Property, speculativeSymbolInfo.Symbol.Kind) 278Assert.Equal("theCustomer As Program.Customer", model.GetSymbolInfo(withBlock.WithStatement.Expression).Symbol.ToTestDisplayString()) 365Assert.Equal("vbNode As Derived", symbolInfo1.Symbol.ToTestDisplayString()) 366Assert.Equal(SymbolKind.Parameter, symbolInfo1.Symbol.Kind) 369Assert.Equal("vbNode As Derived", symbolInfo2.Symbol.ToTestDisplayString()) 370Assert.Equal(SymbolKind.Parameter, symbolInfo2.Symbol.Kind) 372Assert.Same(symbolInfo1.Symbol, symbolInfo2.Symbol) 411Assert.Equal("vbNode As Derived", symbolInfo1.Symbol.ToTestDisplayString()) 412Assert.Equal(SymbolKind.Parameter, symbolInfo1.Symbol.Kind) 415Assert.Equal("vbNode As Derived", symbolInfo2.Symbol.ToTestDisplayString()) 416Assert.Equal(SymbolKind.Parameter, symbolInfo2.Symbol.Kind) 418Assert.Same(symbolInfo1.Symbol, symbolInfo2.Symbol) 463Assert.Equal("vbNode As Derived", symbolInfo1.Symbol.ToTestDisplayString()) 464Assert.Equal(SymbolKind.Parameter, symbolInfo1.Symbol.Kind) 467Assert.Equal("vbNode As Derived", symbolInfo2.Symbol.ToTestDisplayString()) 468Assert.Equal(SymbolKind.Parameter, symbolInfo2.Symbol.Kind) 471Assert.Equal("vbNode As Derived", symbolInfo3.Symbol.ToTestDisplayString()) 472Assert.Equal(SymbolKind.Parameter, symbolInfo3.Symbol.Kind) 474Assert.Same(symbolInfo1.Symbol, symbolInfo2.Symbol) 475Assert.Same(symbolInfo1.Symbol, symbolInfo3.Symbol) 520Assert.Equal("ReadOnly Property Ext.vbNode As Derived", symbolInfo1.Symbol.ToTestDisplayString()) 521Assert.Equal(SymbolKind.Property, symbolInfo1.Symbol.Kind) 524Assert.Equal("ReadOnly Property Ext.vbNode As Derived", symbolInfo2.Symbol.ToTestDisplayString()) 525Assert.Equal(SymbolKind.Property, symbolInfo2.Symbol.Kind) 527Assert.Same(symbolInfo1.Symbol, symbolInfo2.Symbol)
Semantics\XmlLiteralSemanticModelTests.vb (2)
191Assert.Null(symbolInfo.Symbol) 420Dim symbol = TryCast(info.Symbol, PropertySymbol)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (145)
DocumentationComments\DocCommentTests.vb (84)
4771Assert.NotNull(expSymInfo1.Symbol) 4805Assert.NotNull(expSymInfo1.Symbol) 4837Assert.NotNull(expSymInfo1.Symbol) 4871Assert.NotNull(expSymInfo1.Symbol) 4983Assert.NotNull(expSymInfo1.Symbol) 4985TestSymbolAndTypeInfoForType(model, names(5), expSymInfo1.Symbol.OriginalDefinition) 4988Assert.NotNull(expSymInfo3.Symbol) 4989Assert.NotSame(expSymInfo1.Symbol.OriginalDefinition, expSymInfo3.Symbol.OriginalDefinition) 4997Assert.Same(expSymInfo3.Symbol.OriginalDefinition, list(0).OriginalDefinition) 4998Assert.Same(expSymInfo1.Symbol.OriginalDefinition, list(1).OriginalDefinition) 5000TestSymbolAndTypeInfoForType(model, names(1), expSymInfo3.Symbol.OriginalDefinition) 5002TestSymbolAndTypeInfoForType(model, names(2), expSymInfo1.Symbol.OriginalDefinition) 5003TestSymbolAndTypeInfoForType(model, names(3), expSymInfo1.Symbol.OriginalDefinition) 5009Assert.Null(typeParamSymInfo.Symbol) 9115Assert.NotNull(info.Symbol) 9116Assert.Equal("Sub TestStruct.T(p As System.Collections.Generic.List(Of System.Int32), i As TestStruct)", info.Symbol.ToTestDisplayString()) 9303Assert.NotNull(info.Symbol) 9304Assert.Equal("Sub TestStruct.T(Of T)(p As T, i As TestStruct)", info.Symbol.ToTestDisplayString()) 9358Assert.NotNull(info.Symbol) 9359Assert.Equal("Sub TestStruct.T(Of T)(p As T, i As TestStruct)", info.Symbol.ToTestDisplayString()) 9415Assert.NotNull(info.Symbol) 9416Assert.Equal("Sub TestStruct.T(Of T)(p As T, i As TestStruct)", info.Symbol.ToTestDisplayString()) 9474Assert.NotNull(info.Symbol) 9475Assert.Equal("Function TestStruct(Of ZZZ).op_Addition(a As System.Int32, b As TestStruct(Of ZZZ)) As System.String", info.Symbol.ToTestDisplayString()) 9536Assert.NotNull(info.Symbol) 9537Assert.Equal("Function Clazz.TestStruct.op_Addition(a As System.Int32, b As Clazz.TestStruct) As System.String", info.Symbol.ToTestDisplayString()) 9637Assert.NotNull(info.Symbol) 9638Assert.Equal(name, info.Symbol.ToTestDisplayString()) 9825Assert.NotNull(info.Symbol) 9826Assert.Equal(name, info.Symbol.ToTestDisplayString()) 9916Assert.NotNull(info.Symbol) 9917Assert.Equal(name, info.Symbol.ToTestDisplayString()) 9986Assert.NotNull(info.Symbol) 9987Assert.Equal(name, info.Symbol.ToTestDisplayString()) 10044Assert.NotNull(info.Symbol) 10045Assert.Equal("Sub T(Of T).T(Of T).T(Of T)(p As T, i As TestStruct)", info.Symbol.ToTestDisplayString()) 10089Assert.NotNull(actual.Symbol) 10090Assert.Equal(e.Symbols(0), actual.Symbol.ToTestDisplayString) 10232Assert.NotNull(info.Symbol) 10233Assert.Equal(name, info.Symbol.ToTestDisplayString()) 10363Assert.NotNull(info.Symbol) 10364Assert.Equal(name, info.Symbol.ToTestDisplayString()) 10496Assert.NotNull(info.Symbol) 10497Assert.Equal(name, info.Symbol.ToTestDisplayString()) 10654Assert.NotNull(info.Symbol) 10655Assert.Equal(name, info.Symbol.ToTestDisplayString()) 10984Assert.NotNull(info.Symbol) 10986info.Symbol.ToTestDisplayString()) 11162Assert.NotNull(info.Symbol) 11163Assert.Equal("System.Collections.Generic", info.Symbol.ToTestDisplayString()) 11246Assert.NotNull(info.Symbol) 11247Assert.Equal("System.Collections.Generic.List(Of System.Int32)", info.Symbol.ToTestDisplayString()) 11295Assert.NotNull(info.Symbol) 11296Assert.Equal("System.Collections.Generic.List(Of T)", info.Symbol.ToTestDisplayString()) 11345Assert.NotNull(info.Symbol) 11346Assert.Equal("Function System.Object.ToString() As System.String", info.Symbol.ToTestDisplayString()) 11395Assert.NotNull(info.Symbol) 11396Assert.Equal("Function System.Object.ToString() As System.String", info.Symbol.ToTestDisplayString()) 11537Dim actualSymbol = model.GetSymbolInfo(crefSyntax).Symbol 11572Dim actualSymbol = model.GetSymbolInfo(crefSyntax).Symbol 11651Assert.Null(info0.Symbol) ' As in dev11. 11701Assert.Equal("C.F As System.Int32", model.GetSymbolInfo(crefSyntaxes(0)).Symbol.ToTestDisplayString()) 11702Assert.Equal("S.F As System.Int32", model.GetSymbolInfo(crefSyntaxes(1)).Symbol.ToTestDisplayString()) 11703Assert.Equal("Property I.P As System.Int32", model.GetSymbolInfo(crefSyntaxes(2)).Symbol.ToTestDisplayString()) 11704Assert.Equal("M.F As System.Int32", model.GetSymbolInfo(crefSyntaxes(3)).Symbol.ToTestDisplayString()) 11705Assert.Equal("E.F", model.GetSymbolInfo(crefSyntaxes(4)).Symbol.ToTestDisplayString()) 11735Assert.Equal("Outer.Inner.F As System.Int32", model.GetSymbolInfo(crefSyntax).Symbol.ToTestDisplayString()) 11960Assert.NotNull(actual.Symbol) 11961Assert.Equal(expected(0), actual.Symbol.ToTestDisplayString) 11968If actual.Symbol IsNot Nothing AndAlso actual.Symbol.Kind = SymbolKind.TypeParameter Then ' Works everywhere since we want it to work in name attributes. 11969Assert.Equal(actual.Symbol, typeInfo.Type) 12041Assert.NotNull(actual.Symbol) 12042Assert.Equal(expected(0), actual.Symbol.ToTestDisplayString) 12045Assert.Equal(typeInfo.Type, actual.Symbol) 12047Return ImmutableArray.Create(Of Symbol)(DirectCast(actual.Symbol, Symbol)) 12075Assert.NotNull(expSymInfo.Symbol) 12076Assert.Same(expected, expSymInfo.Symbol.OriginalDefinition) 12252Assert.Equal("Sub C(Of ?).f()", symbolInfo1.Symbol.ToTestDisplayString()) 12258Assert.Equal("?", symbolInfo.Symbol.ToTestDisplayString()) 12312Assert.Equal("Sub C(Of ?).f()", symbolInfo1.Symbol.ToTestDisplayString()) 12318Assert.Equal("?", symbolInfo.Symbol.ToTestDisplayString()) 12438Dim typeParameter = DirectCast(model.GetSymbolInfo(name).Symbol, TypeParameterSymbol)
SymbolDisplay\SymbolDisplayTests.vb (4)
5267ToDisplayParts(model.GetSymbolInfo(actualThis).Symbol, SymbolDisplayFormat.MinimallyQualifiedFormat), 5279ToDisplayParts(model.GetSymbolInfo(escapedThis).Symbol, SymbolDisplayFormat.MinimallyQualifiedFormat), 5702Dim op = model.GetSymbolInfo(binaryExpression).Symbol 5809op = model.GetSymbolInfo(binaryExpression).Symbol
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (32)
983Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString()) 1006Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString()) 1009Assert.Equal("Public Property bb As Integer", info.Symbol.ToDisplayString()) 1012Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString()) 1037Assert.Equal("Public Property a As Integer", info.Symbol.ToDisplayString()) 1040Assert.Equal("args As String()", info.Symbol.ToDisplayString()) 1043Assert.Equal("Public Property b As String", info.Symbol.ToDisplayString()) 1046Assert.Equal("Public Property args As String()", info.Symbol.ToDisplayString()) 1049Assert.Equal("Public Property a As Integer", info.Symbol.ToDisplayString()) 1073Assert.Equal("Public Sub New()", info.Symbol.ToDisplayString()) 1076Assert.Equal("Program", info.Symbol.ToDisplayString()) 1100Assert.Equal("Public Sub New()", info.Symbol.ToDisplayString()) 1103Assert.Equal("Program", info.Symbol.ToDisplayString()) 1134Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString()) 1163Assert.Equal("Public ReadOnly Property aa As Integer", info.Symbol.ToDisplayString()) 1187Assert.Equal("Public ReadOnly Property aa As String", info.Symbol.ToDisplayString()) 1216Assert.Equal("Public ReadOnly Property aa As String", info.Symbol.ToDisplayString()) 1239Dim querySymbol = model.GetSymbolInfo(DirectCast(nodes(0), ExpressionSyntax)).Symbol 1243querySymbol = model.GetSymbolInfo(DirectCast(nodes(1), ExpressionSyntax)).Symbol 1248model.GetSymbolInfo(DirectCast(nodes(2), ExpressionSyntax)).Symbol.ToDisplayString()) 1272Assert.Equal("Public Sub New(aa As Integer, bb As Integer)", info.Symbol.ToDisplayString()) 1296model.GetSymbolInfo(DirectCast(nodes(0), ExpressionSyntax)).Symbol.ToDisplayString()) 1452model.GetSymbolInfo(DirectCast(nodes(0), ExpressionSyntax)).Symbol.ToDisplayString()) 1479model.GetSymbolInfo(DirectCast(nodes(0), ExpressionSyntax)).Symbol.ToDisplayString()) 1506model.GetSymbolInfo(DirectCast(nodes(0), ExpressionSyntax)).Symbol.ToDisplayString()) 1533model.GetSymbolInfo(DirectCast(nodes(0), ExpressionSyntax)).Symbol.ToDisplayString()) 1558model.GetSymbolInfo(DirectCast(nodes(0), ExpressionSyntax)).Symbol.ToDisplayString()) 1560model.GetSymbolInfo(DirectCast(nodes(1), ExpressionSyntax)).Symbol.ToDisplayString()) 1562model.GetSymbolInfo(DirectCast(nodes(2), ExpressionSyntax)).Symbol.ToDisplayString()) 1585model.GetSymbolInfo(DirectCast(nodes(0), ExpressionSyntax)).Symbol.ToDisplayString()) 1587model.GetSymbolInfo(DirectCast(nodes(1), ExpressionSyntax)).Symbol.ToDisplayString()) 1589model.GetSymbolInfo(DirectCast(nodes(2), ExpressionSyntax)).Symbol.ToDisplayString())
SymbolsTests\ExtensionMethods\ExtensionMethodTests.vb (4)
2406Dim sym = model.GetSymbolInfo(node).Symbol 2409Dim sym2 = model.GetSymbolInfo(node2).Symbol 2417sym = model.GetSymbolInfo(node).Symbol 2420sym2 = model.GetSymbolInfo(node2).Symbol
SymbolsTests\Metadata\WinMdEventTest.vb (3)
1466Dim symbol = model.GetSymbolInfo(syntax).Symbol 1561AssertEx.All(references, Function(ref) model.GetSymbolInfo(ref).Symbol.Equals(eventSymbol)) 1700Dim symbol = model.GetSymbolInfo(syntax).Symbol
SymbolsTests\Source\BindingsTests.vb (1)
469Dim sysCollectionsType = TryCast(sysCollectionsSymInfo.Symbol, TypeSymbol)
SymbolsTests\Source\EventTests.vb (3)
2307Assert.Equal("Event I.E()", symbolInfo.Symbol.ToTestDisplayString()) 2339Assert.Equal("Event S.E()", symbolInfo.Symbol.ToTestDisplayString()) 2383Assert.Null(symbolInfo.Symbol)
SymbolsTests\Source\GroupClassTests.vb (12)
3286Assert.Equal(SymbolKind.Field, symbolInfo.Symbol.Kind) 3287Assert.Equal("Factory.DefaultInstanceTest2 As DefaultInstanceTest2", symbolInfo.Symbol.ToTestDisplayString()) 3358Assert.Equal(SymbolKind.Method, symbolInfo.Symbol.Kind) 3359Assert.Equal("Function Factory.DefaultInstanceTest2() As DefaultInstanceTest2", symbolInfo.Symbol.ToTestDisplayString()) 3764Assert.Equal(SymbolKind.NamedType, symbolInfo.Symbol.Kind) 3765Assert.Equal("Form1", symbolInfo.Symbol.ToTestDisplayString()) 3772Assert.Equal(SymbolKind.Property, symbolInfo.Symbol.Kind) 3773Assert.Equal("Property My.MyProject.MyForms.Form1 As Form1", symbolInfo.Symbol.ToTestDisplayString()) 3780Assert.Equal(SymbolKind.Property, symbolInfo.Symbol.Kind) 3781Assert.Equal("Property My.MyProject.MyForms.Form1 As Form1", symbolInfo.Symbol.ToTestDisplayString()) 3788Assert.Equal(SymbolKind.Property, symbolInfo.Symbol.Kind) 3789Assert.Equal("Property My.MyProject.MyForms.Form1 As Form1", symbolInfo.Symbol.ToTestDisplayString())
SymbolsTests\Source\LocalTests.vb (2)
34Dim local = DirectCast(model.GetSymbolInfo(expressionSyntax).Symbol, ILocalSymbol) 61Dim local = DirectCast(model.GetSymbolInfo(expressionSyntax).Symbol, ILocalSymbol)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
CompilationTestUtils.vb (2)
551summary.Symbol = DirectCast(symbolInfo.Symbol, Symbol) 580summary.Symbol = DirectCast(symbolInfo.Symbol, Symbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (58)
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.vb (2)
28If TypeOf symbolInfo.Symbol Is IMethodSymbol AndAlso 29DirectCast(symbolInfo.Symbol, IMethodSymbol).MethodKind = MethodKind.UserDefinedOperator Then
CodeCleanup\Providers\FixIncorrectTokensCodeCleanupProvider.vb (1)
116Dim symbol = _semanticModel.GetSymbolInfo(parent.Left, _cancellationToken).Symbol
Editing\VisualBasicImportAdder.vb (2)
49Dim Symbol = model.GetSymbolInfo(fullName).Symbol 50Dim nsSymbol = TryCast(model.GetSymbolInfo(namespacePart).Symbol, INamespaceSymbol)
InvocationExpressionSyntaxExtensions.vb (1)
49Dim symbol As ISymbol = semanticModel.GetSymbolInfo(invocationExpression.Expression).Symbol
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb\ExpressionSyntaxExtensions.vb (1)
395Dim method = TryCast(semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol, IMethodSymbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb\SyntaxTreeExtensions.vb (1)
326Dim objectCreationType = TryCast(symbolInfo.Symbol, ITypeSymbol)
ParenthesizedExpressionSyntaxExtensions.vb (1)
281Dim symbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol
Recommendations\VisualBasicRecommendationServiceRunner.vb (11)
166Dim leftHandSymbol = TryCast(leftHandSymbolInfo.Symbol, INamespaceOrTypeSymbol) 202If leftHandTypeInfo.Type IsNot Nothing AndAlso leftHandTypeInfo.Type.Equals(leftHandSymbolInfo.Symbol) Then 204If leftHandSpeculativeBinding.Symbol IsNot Nothing AndAlso 205leftHandSpeculativeBinding.Symbol.ContainingNamespace?.IsMyNamespace(_context.SemanticModel.Compilation) Then 220If container.IsErrorType() AndAlso leftHandSymbolInfo.Symbol IsNot Nothing Then 222container = leftHandSymbolInfo.Symbol.GetSymbolType() 227If leftHandSymbolInfo.Symbol IsNot Nothing Then 228Dim firstSymbol = leftHandSymbolInfo.Symbol 260If TypeOf leftHandSymbolInfo.Symbol IsNot INamespaceOrTypeSymbol AndAlso speculativeAliasBinding Is Nothing AndAlso Equals(firstSymbol.GetSymbolType(), speculativeTypeBinding.Type) Then 330If leftHandSymbolInfo.Symbol IsNot Nothing AndAlso 331leftHandSymbolInfo.Symbol.IsMyFormsProperty(_context.SemanticModel.Compilation) Then
Rename\LocalConflictVisitor.vb (2)
151Dim symbol = semanticModel.GetSymbolInfo(controlVariable).Symbol 196Dim symbol = semanticModel.GetSymbolInfo(identifierToken.Value).Symbol
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
403Dim symbol = Me._speculativeModel.GetSymbolInfo(token.Parent, Me._cancellationToken).Symbol 484If symbolInfo.Symbol Is Nothing Then 487symbols = SpecializedCollections.SingletonEnumerable(symbolInfo.Symbol)
SemanticModelExtensions.vb (4)
60ElseIf symbolInfo.Symbol IsNot Nothing Then 61symbol = TryCast(symbolInfo.Symbol, INamespaceOrTypeSymbol) 88Let ns = TryCast(info.Symbol, INamespaceSymbol) 253Dim member = TryCast(semanticModel.GetSymbolInfo(argumentList.Parent, cancellationToken).Symbol, IMethodSymbol)
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
101Dim symbol = semanticModel.GetSymbolInfo(typedParent, cancellationToken).Symbol
Simplification\Reducers\VisualBasicExtensionMethodReducer.vb (5)
40If (Not targetSymbol.Symbol Is Nothing) AndAlso targetSymbol.Symbol.Kind = SymbolKind.Method Then 41Dim targetMethodSymbol = DirectCast(targetSymbol.Symbol, IMethodSymbol) 56Dim oldSymbol = semanticModel.GetSymbolInfo(invocationExpression, cancellationToken).Symbol 60SpeculativeBindingOption.BindAsExpression).Symbol
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (1)
70Dim symbol = semanticModel.GetSymbolInfo(node).Symbol
Simplification\Simplifiers\ExpressionSimplifier.vb (1)
278Dim symbolForMemberAccess = semanticModel.GetSymbolInfo(DirectCast(memberAccess.Parent, MemberAccessExpressionSyntax), cancellationToken).Symbol
Simplification\Simplifiers\NameSimplifier.vb (1)
326Dim symbolForName = semanticModel.GetSymbolInfo(DirectCast(name.Parent, QualifiedNameSyntax), cancellationToken).Symbol
Simplification\VisualBasicSimplificationService.Expander.vb (11)
238If (Not binding.Symbol Is Nothing) Then 319Dim symbol = _semanticModel.GetSymbolInfo(node.Expression, _cancellationToken).Symbol 416Dim symbolForQualifiedName = _semanticModel.GetSymbolInfo(node).Symbol 423Dim symbolForLeftPart = _semanticModel.GetSymbolInfo(node.Left).Symbol 436If symbolForQualifiedName.Equals(_semanticModel.GetSpeculativeSymbolInfo(node.SpanStart, qualifiedNameWithModuleName, SpeculativeBindingOption.BindAsExpression).Symbol) Then 450Dim symbolForMemberAccess = _semanticModel.GetSymbolInfo(node).Symbol 453Dim symbolForLeftPart = _semanticModel.GetSymbolInfo(node.Expression).Symbol 471If symbolForMemberAccess.Equals(_semanticModel.GetSpeculativeSymbolInfo(node.SpanStart, memberAccessWithModuleName, SpeculativeBindingOption.BindAsExpression).Symbol) Then 565Dim symbol = _semanticModel.GetSymbolInfo(originalSimpleName.Identifier).Symbol 730Dim newSymbol = _semanticModel.GetSpeculativeSymbolInfo(originalNode.SpanStart, left, SpeculativeBindingOption.BindAsExpression).Symbol 744symbol.Equals(_semanticModel.GetSpeculativeSymbolInfo(originalNode.SpanStart, result, SpeculativeBindingOption.BindAsExpression).Symbol))
SpeculationAnalyzer.vb (2)
439Dim originalSymbol = Me.OriginalSemanticModel.GetCollectionInitializerSymbolInfo(originalInitializer, CancellationToken).Symbol 440Dim newSymbol = Me.SpeculativeSemanticModel.GetCollectionInitializerSymbolInfo(newInitializer, CancellationToken).Symbol
VariableDeclaratorSyntaxExtensions.vb (1)
33Return TryCast(semanticModel.GetSymbolInfo(asNewType).Symbol, ITypeSymbol)
VisualBasicSyntaxContextExtensions.vb (1)
123Dim objectCreationType = TryCast(symbolInfo.Symbol, ITypeSymbol)
VisualBasicTypeInferenceService.TypeInferrer.vb (2)
294Dim namedType = TryCast(info.Symbol, INamedTypeSymbol) 986SemanticModel.GetSymbolInfo(identifier.Identifier).Symbol?.Kind = SymbolKind.Parameter Then
VisualBasicUnnecessaryImportsProvider.vb (3)
117Dim namespaceOrType = TryCast(semanticInfo.Symbol, INamespaceOrTypeSymbol) 125aliasSymbol.Target.Equals(semanticInfo.Symbol) AndAlso 140Dim namespaceOrType = TryCast(semanticInfo.Symbol, INamespaceOrTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
54Dim symbol = model.GetSymbolInfo(o).Symbol
Microsoft.CodeAnalysis.Workspaces (53)
AbstractSpeculationAnalyzer.cs (13)
297if (SymbolsAreCompatibleCore(originalSymbolInfo.Symbol, newSymbolInfo.Symbol, performEquivalenceCheck, requireNonNullSymbols)) 626var originalIsStaticAccess = IsStaticAccess(_semanticModel.GetSymbolInfo(originalExpression, CancellationToken).Symbol); 627var replacedIsStaticAccess = IsStaticAccess(this.SpeculativeSemanticModel.GetSymbolInfo(newExpression, CancellationToken).Symbol); 683var originalExpressionSymbol = this.OriginalSemanticModel.GetSymbolInfo(currentOriginalNode).Symbol; 684var replacedExpressionSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(currentReplacedNode).Symbol; 714var attributeSym = this.OriginalSemanticModel.GetSymbolInfo(attribute).Symbol; 715var newAttributeSym = this.SpeculativeSemanticModel.GetSymbolInfo(newAttribute).Symbol; 818var symbol = this.OriginalSemanticModel.GetSymbolInfo(type).Symbol; 823newSymbol = this.SpeculativeSemanticModel.GetSymbolInfo(newType, _cancellationToken).Symbol; 828newSymbol = this.OriginalSemanticModel.GetSpeculativeSymbolInfo(type.SpanStart, newType, bindingOption).Symbol; 858var symbol = originalSymbolInfo.Symbol; 859var newSymbol = newSymbolInfo.Symbol;
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (5)
64if (await SymbolFinder.OriginalSymbolsMatchAsync(state.Solution, searchSymbol, symbolInfo.Symbol, cancellationToken).ConfigureAwait(false)) 548var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol; 564if (Matches(info.Symbol, notNullOriginalUnreducedSymbol2)) 681if (symbolInfo.Symbol != null) 683switch (symbolInfo.Symbol.Kind)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
198var attributeSymbol = semanticModel.GetSymbolInfo(attributeNode, cancellationToken).Symbol?.ContainingType;
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
238var constructor = state.SemanticModel.GetSymbolInfo(node, cancellationToken).Symbol;
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (2)
145if (await HasInheritanceRelationshipSingleAsync(symbol, symbolInfo.Symbol).ConfigureAwait(false)) 146return (matched: true, symbolInfo.Symbol!, CandidateReason.None);
ISemanticFactsExtensions.cs (1)
95if (IsUserDefinedOperator(symbolInfo.Symbol))
ReassignedVariable\AbstractReassignedVariableService.cs (2)
105var symbol = semanticModel.GetSymbolInfo(identifier, cancellationToken).Symbol; 264var symbol = semanticModel.GetSymbolInfo(id, cancellationToken).Symbol;
Rename\ConflictEngine\ConflictResolver.cs (2)
135return symbolInfo.Symbol == null 137: ImmutableArray.Create(symbolInfo.Symbol);
Rename\RenameUtilities.cs (3)
158if (symbolInfo.Symbol != null) 160if (symbolInfo.Symbol.IsTupleType()) 165return TokenRenameInfo.CreateSingleSymbolTokenInfo(symbolInfo.Symbol);
Shared\Extensions\SemanticEquivalence.cs (4)
139return EqualityComparer<ISymbol>.Default.Equals(info1.Symbol, info2.Symbol); 143return SymbolEquivalenceComparer.Instance.Equals(info1.Symbol, info2.Symbol);
Shared\Utilities\SemanticMap.cs (1)
37return _expressionToInfoMap.Values.Concat(_tokenToInfoMap.Values).Select(info => info.Symbol).Distinct();
Shared\Utilities\SemanticMap.Walker.cs (1)
51=> info.Symbol == null && info.CandidateSymbols.Length == 0;
Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (5)
54if (symbolInfo.Symbol == null) 57if (!simplifierOptions.TryGetQualifyMemberAccessOption(symbolInfo.Symbol.Kind, out var optionValue)) 61if (!symbolInfo.Symbol.IsStatic && optionValue.Value) 66if (!symbolInfo.Symbol.Equals(newSymbolInfo.Symbol, SymbolEqualityComparer.IncludeNullability))
SimplificationHelpers.cs (5)
88if (!IsValidSymbolInfo(symbolInfo.Symbol)) 91return symbolInfo.Symbol; 103if (IsValidSymbolInfo(expressionInfo.Symbol)) 105if (expressionInfo.Symbol is INamespaceOrTypeSymbol) 108if (expressionInfo.Symbol.IsThisParameter())
SymbolInfoExtensions.cs (5)
19if (info.Symbol == null) 26builder.Add(info.Symbol); 33=> info.Symbol ?? info.CandidateSymbols.FirstOrDefault(); 37if (info.Symbol != null) 39return ImmutableArray.Create(info.Symbol);
SymbolKey.SymbolKeyReader.cs (2)
751if (info.Symbol != null) 752return new SymbolKeyResolution(info.Symbol);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SerializationTests.cs (1)
69var symbol = model.GetSpeculativeSymbolInfo(0, name, SpeculativeBindingOption.BindAsExpression).Symbol;
SymbolKeyTests.cs (1)
549var symbols = tree.GetRoot().DescendantNodes().OfType<CSharp.Syntax.InvocationExpressionSyntax>().Select(s => model.GetSymbolInfo(s).Symbol).ToList();
Microsoft.VisualStudio.LanguageServices (1)
Progression\GraphQueries\CallsGraphQuery.cs (1)
54var newSymbol = semanticModel.GetSymbolInfo(syntaxNode, cancellationToken).Symbol;
Microsoft.VisualStudio.LanguageServices.CSharp (5)
CodeModel\MethodXml\MethodXmlBuilder.cs (4)
391if (SemanticModel.GetSymbolInfo(objectCreationExpression.Type).Symbol is not ITypeSymbol type) 479var symbol = SemanticModel.GetSymbolInfo(memberAccessExpression).Symbol; 486var leftHandSymbol = SemanticModel.GetSymbolInfo(memberAccessExpression.Expression).Symbol; 518var symbol = SemanticModel.GetSymbolInfo(identifierName).Symbol;
LanguageService\CSharpHelpContextService.cs (1)
164symbol = semanticModel.GetSymbolInfo(genericName, cancellationToken).Symbol ?? semanticModel.GetTypeInfo(genericName, cancellationToken).Type;
Microsoft.VisualStudio.LanguageServices.VisualBasic (11)
CodeModel\MethodXML\MethodXmlBuilder.vb (6)
125Dim eventSymbol = TryCast(SemanticModel.GetSymbolInfo(eventExpression).Symbol, IEventSymbol) 294Dim type = TryCast(SemanticModel.GetSymbolInfo(objectCreationExpression.Type).Symbol, ITypeSymbol) 352symbolOpt = If(symbolOpt, SemanticModel.GetSymbolInfo(memberAccess).Symbol) 363Dim leftHandSymbol = SemanticModel.GetSymbolInfo(memberAccess.GetExpressionOfMemberAccessExpression()).Symbol 404symbolOpt = If(symbolOpt, SemanticModel.GetSymbolInfo(identifierName).Symbol) 664Dim delegateSymbol = TryCast(SemanticModel.GetSymbolInfo(delegateExpression).Symbol, IMethodSymbol)
Help\VisualBasicHelpContextService.Visitor.vb (5)
437Dim symbol = _semanticModel.GetSymbolInfo(node, _cancellationToken).Symbol 833Dim symbol = _semanticModel.GetSymbolInfo(node, _cancellationToken).Symbol 846Dim symbol = _semanticModel.GetSymbolInfo(node.Right, _cancellationToken).Symbol 868If info.Symbol IsNot Nothing Then 869Dim symbolType = TryCast(info.Symbol.GetSymbolType(), IArrayTypeSymbol)