153 references to Conversion
Microsoft.CodeAnalysis.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
426if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
142MethodKind.Conversion) 235=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
144if (symbol.MethodKind == MethodKind.Conversion)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (2)
59MethodKind = MethodKind.Conversion; 83MethodKind = MethodKind.Conversion;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (1)
41public override MethodKind MethodKind => MethodKind.Conversion;
Microsoft.CodeAnalysis.CSharp (21)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
116if (symbol.MethodKind == MethodKind.Conversion)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
331case MethodKind.Conversion: 542case MethodKind.Conversion:
Symbols\Compilation_WellKnownMembers.cs (1)
309if (methodKind == MethodKind.Conversion || methodKind == MethodKind.UserDefinedOperator)
Symbols\MemberSymbolExtensions.cs (2)
173return methodSymbol.MethodKind == MethodKind.UserDefinedOperator || methodSymbol.MethodKind == MethodKind.Conversion; 193return symbol.Kind == SymbolKind.Method && ((MethodSymbol)symbol).MethodKind == MethodKind.Conversion;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1245return IsValidUserDefinedOperatorSignature(1) ? MethodKind.Conversion : MethodKind.Ordinary;
Symbols\MethodSymbol.cs (1)
611case MethodKind.Conversion:
Symbols\MethodSymbolExtensions.cs (1)
133case MethodKind.Conversion:
Symbols\NamedTypeSymbol.cs (1)
220if (candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } method)
Symbols\PublicModel\MethodSymbol.cs (2)
43case MethodKind.Conversion: 44return MethodKind.Conversion;
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
263(interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator)
Symbols\Source\SourceMemberContainerSymbol.cs (2)
2067if (conversion is { MethodKind: MethodKind.Conversion }) 4059case MethodKind.Conversion:
Symbols\Source\SourceMemberMethodSymbol.cs (2)
345ErrorCode code = (this.MethodKind == MethodKind.Conversion || this.MethodKind == MethodKind.UserDefinedOperator) ? 356code = (this.MethodKind == MethodKind.Conversion || this.MethodKind == MethodKind.UserDefinedOperator) ?
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1664case MethodKind.Conversion:
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
43? MethodKind.Conversion
Symbols\TypeSymbol.cs (2)
2173isOperator = interfaceMethod.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion; 2181(((MethodSymbol)member).MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion) != isOperator.GetValueOrDefault())
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
19conversion.MethodSymbol.MethodKind == MethodKind.Conversion &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
67if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
215methodKind: MethodKind.Conversion);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
156if (method.MethodKind == MethodKind.Conversion)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
Emit\EditAndContinue\SymbolMatcherTests.cs (8)
1719var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1720var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1761var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1762var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1813var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1814var members0 = compilation0.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1860var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray(); 1905var members1 = compilation1.GetMember<NamedTypeSymbol>("A").GetMembers().OfType<MethodSymbol>().Where(m => m.MethodKind is (MethodKind.Conversion or MethodKind.UserDefinedOperator)).ToArray();
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (1)
65case MethodKind.Conversion:
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
1988MethodKind.Conversion => CSharpFeaturesResources.conversion_operator, 2541IMethodSymbol { MethodKind: MethodKind.Conversion or MethodKind.UserDefinedOperator }
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
215methodKind: MethodKind.Conversion);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (29)
Compilation\GetSemanticInfoTests.cs (1)
2542Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)symbol.ContainingSymbol).MethodKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
4435Assert.Equal(MethodKind.Conversion, conversion.MethodKind); 4466Assert.Equal(MethodKind.Conversion, conversion.MethodKind);
DocumentationComments\CrefTests.cs (1)
3278Assert.Equal(MethodKind.Conversion, ((IMethodSymbol)info.CandidateSymbols[0]).MethodKind);
Symbols\CheckedUserDefinedOperatorsTests.cs (10)
2504Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind); 2541Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2542Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 2580Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2581Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 2620Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 2621Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind); 3190Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind); 3223Assert.Equal(MethodKind.Conversion, opSymbols[0].MethodKind); 3224Assert.Equal(MethodKind.Conversion, opSymbols[1].MethodKind);
Symbols\ConversionTests.cs (3)
1722var conversionSymbols = destinationType.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Conversion); 1803Assert.Equal(MethodKind.Conversion, method.MethodKind); 1837Assert.Equal(MethodKind.Conversion, method.MethodKind);
Symbols\StaticAbstractMembersInInterfacesTests.cs (12)
28675Assert.Equal(MethodKind.Conversion, cM01.MethodKind); 28700Assert.Equal(MethodKind.Conversion, cM02.MethodKind); 29018Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29019Assert.Equal(MethodKind.Conversion, c1.GetMember<MethodSymbol>(opName).MethodKind); 29040Assert.Equal(MethodKind.Conversion, c2M01.MethodKind); 29098Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29194Assert.Equal(MethodKind.Conversion, m01.MethodKind); 29285Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29292Assert.Equal(MethodKind.Conversion, c2M01.MethodKind); 29398Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 29404Assert.Equal(MethodKind.Conversion, c1M01.MethodKind); 32628Assert.Equal(MethodKind.Conversion, opSymbol.MethodKind);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ConversionExtensions.cs (1)
19conversion.MethodSymbol.MethodKind == MethodKind.Conversion &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
67if (symbol is IMethodSymbol { MethodKind: MethodKind.Conversion })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
156if (method.MethodKind == MethodKind.Conversion)
Microsoft.CodeAnalysis.Features (5)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
360MethodKind.BuiltinOperator or MethodKind.UserDefinedOperator or MethodKind.Conversion => FeaturesResources.operator_,
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
78MethodKind: MethodKind.Ordinary or MethodKind.ExplicitInterfaceImplementation or MethodKind.UserDefinedOperator or MethodKind.Conversion
Shared\Extensions\ISymbolExtensions_2.cs (1)
99MethodKind.Conversion or
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (2)
59MethodKind = MethodKind.Conversion; 83MethodKind = MethodKind.Conversion;
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
120new { SymbolKind = SymbolKind.Method, MethodKind = MethodKind.Conversion, ReturnsVoid = false },
Microsoft.CodeAnalysis.VisualBasic (28)
Analysis\FlowAnalysis\DataFlowPass.vb (4)
1258Case MethodKind.Conversion, MethodKind.UserDefinedOperator 1270Case MethodKind.Conversion, MethodKind.UserDefinedOperator 1286Case MethodKind.Conversion, MethodKind.UserDefinedOperator 1324Case MethodKind.Conversion, MethodKind.UserDefinedOperator
Binding\Binder_Utils.vb (1)
1649MethodKindConversion = CUInt(MethodKind.Conversion) << MethodKindShift
Binding\DocumentationCommentCrefBinder.vb (1)
1063CollectOperatorsAndConversionsInType(type, symbols, MethodKind.Conversion,
BoundTree\BoundUserDefinedConversion.vb (1)
62Debug.Assert(underlyingCall.Method.MethodKind = MethodKind.Conversion AndAlso underlyingCall.Method.ParameterCount = 1)
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (1)
726If(method.MethodKind = MethodKind.UserDefinedOperator OrElse method.MethodKind = MethodKind.Conversion, "operator",
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.vb (1)
86If symbol.MethodKind = MethodKind.Conversion Then
Semantics\Operators.vb (2)
2814Debug.Assert(method.MethodKind = MethodKind.Conversion) 2836CollectUserDefinedOperators(source, destination, MethodKind.Conversion,
SymbolDisplay\SymbolDisplayVisitor.Members.vb (2)
244Case MethodKind.Conversion 361Case MethodKind.Conversion
Symbols\Metadata\PE\PEMethodSymbol.vb (4)
445Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ExplicitConversionName, True) 447Return ComputeMethodKindForPotentialOperatorOrConversion(opInfo, MethodKind.Conversion, WellKnownMemberNames.ImplicitConversionName, True) 523Debug.Assert(potentialMethodKind = MethodKind.Conversion OrElse potentialMethodKind = MethodKind.UserDefinedOperator) 560If potentialMethodKind = MethodKind.Conversion AndAlso Not outputType.IsSameTypeIgnoringAll(contender.ReturnType) Then
Symbols\MethodSymbolExtensions.vb (1)
86Case MethodKind.UserDefinedOperator, MethodKind.Conversion
Symbols\Source\OverrideHidingHelper.vb (1)
499Case MethodKind.Conversion, MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Ordinary, MethodKind.DeclareMethod,
Symbols\Source\SourceMemberContainerTypeSymbol.vb (3)
3434method.MethodKind <> MethodKind.Conversion Then 3599Case MethodKind.Conversion 3621If methodMethodKind = MethodKind.Conversion Then
Symbols\Source\SourceMethodSymbol.vb (1)
1965MethodKind.Conversion,
Symbols\Source\SourceParameterSymbol.vb (1)
208Case MethodKind.Conversion,
Symbols\Symbol.vb (2)
620Case MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Conversion 658Case MethodKind.Ordinary, MethodKind.DeclareMethod, MethodKind.ReducedExtension, MethodKind.DelegateInvoke, MethodKind.UserDefinedOperator, MethodKind.Conversion
Symbols\Symbol_Attributes.vb (1)
81MethodKind.Conversion,
Symbols\SymbolExtensions.vb (1)
59Case MethodKind.Conversion, MethodKind.UserDefinedOperator, MethodKind.BuiltinOperator
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
163methodKind:=MethodKind.Conversion)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
157If method.MethodKind = MethodKind.Conversion Then
Microsoft.CodeAnalysis.VisualBasic.Features (3)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
2034If method.MethodKind = MethodKind.Conversion OrElse method.MethodKind = MethodKind.UserDefinedOperator Then
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
279method.MethodKind = MethodKind.Conversion
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
163methodKind:=MethodKind.Conversion)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (1)
1152Assert.Equal(MethodKind.Conversion, sym1.MethodKind)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (17)
SymbolsTests\CheckedUserDefinedOperatorsTests.vb (2)
558Assert.Equal(MethodKind.Conversion, operators(0).MethodKind) 613Assert.Equal(MethodKind.Conversion, m.MethodKind)
SymbolsTests\Metadata\PE\LoadingOperators.vb (8)
565New BaseLine(MethodKind.Conversion, "Public Shared Overloads Narrowing Operator CType(x As A1) As Byte"), 570New BaseLine(MethodKind.Conversion, "Public Shared Overloads Widening Operator CType(x As A1) As Integer"), 1161New BaseLine(MethodKind.Conversion, "Public Shared Overloads Narrowing Operator CType(x As A1) As Byte"), 1166New BaseLine(MethodKind.Conversion, "Public Shared Overloads Widening Operator CType(x As A1) As Integer"), 1923New BaseLine(MethodKind.Conversion, "Public Shared Overloads Narrowing Operator CType(x As A1) As Byte"), 1928New BaseLine(MethodKind.Conversion, "Public Shared Overloads Widening Operator CType(x As A1) As Integer"), 2804Assert.Equal(MethodKind.Conversion, op_Implicit.MethodKind) 2805Assert.Equal(MethodKind.Conversion, op_Explicit.MethodKind)
SymbolsTests\Source\OperatorsTests.vb (7)
180New BaseLine(MethodKind.Conversion, "op_Implicit"), 181New BaseLine(MethodKind.Conversion, "op_Explicit") 374New BaseLine(MethodKind.Conversion, "op_Explicit"), 375New BaseLine(MethodKind.Conversion, "op_Implicit"), 376New BaseLine(MethodKind.Conversion, "op_Explicit"), 537New BaseLine(MethodKind.Conversion, "op_Implicit"), 538New BaseLine(MethodKind.Conversion, "op_Explicit")
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (1)
157If method.MethodKind = MethodKind.Conversion Then
Microsoft.CodeAnalysis.Workspaces (8)
Editing\SyntaxGenerator.cs (2)
280if (method.MethodKind is not (MethodKind.UserDefinedOperator or MethodKind.Conversion)) 747case MethodKind.UserDefinedOperator or MethodKind.Conversion:
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
20=> symbol is { MethodKind: MethodKind.Conversion, Name: WellKnownMemberNames.ExplicitConversionName or WellKnownMemberNames.ImplicitConversionName } &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
426if (method is { MethodKind: MethodKind.UserDefinedOperator or MethodKind.Conversion } ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
142MethodKind.Conversion) 235=> symbol is IMethodSymbol { MethodKind: MethodKind.Conversion };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
144if (symbol.MethodKind == MethodKind.Conversion)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (1)
41public override MethodKind MethodKind => MethodKind.Conversion;
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
UtilityTest\DocumentationCommentIdTests.cs (2)
314CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Explicit(Acme.Widget)~System.Int32", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int32"); 315CheckDeclarationId<IMethodSymbol>("M:Acme.Widget.op_Implicit(Acme.Widget)~System.Int64", compilation, m => m.MethodKind == MethodKind.Conversion && m.Parameters.Length == 1 && m.ReturnType.Name == "Int64");
Microsoft.VisualStudio.LanguageServices (4)
Library\ObjectBrowser\Lists\MemberListItem.cs (1)
42Kind = methodSymbol.MethodKind is MethodKind.Conversion or
Progression\GraphBuilder.cs (2)
536case MethodKind.Conversion: 624var isOperator = method.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion;
Progression\GraphNodeIdCreation.cs (1)
322if (member is IMethodSymbol methodSymbol && methodSymbol.MethodKind == MethodKind.Conversion)
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService.cs (1)
2202case MethodKind.Conversion:
ObjectBrowser\DescriptionBuilder.cs (2)
197not MethodKind.Conversion) 203if (methodSymbol.MethodKind == MethodKind.Conversion)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
163methodKind: MethodKind.Conversion);
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ObjectBrowser\DescriptionBuilder.vb (1)
116Case MethodKind.Conversion, MethodKind.UserDefinedOperator