Remove Semantics.ConversionKind.

上级 e2afbb28
...@@ -666,7 +666,6 @@ private ILocalFunctionStatement CreateBoundLocalFunctionStatementOperation(Bound ...@@ -666,7 +666,6 @@ private ILocalFunctionStatement CreateBoundLocalFunctionStatementOperation(Bound
private IOperation CreateBoundConversionOperation(BoundConversion boundConversion) private IOperation CreateBoundConversionOperation(BoundConversion boundConversion)
{ {
ConversionKind conversionKind = GetConversionKind(boundConversion.ConversionKind);
bool isImplicit = boundConversion.WasCompilerGenerated; bool isImplicit = boundConversion.WasCompilerGenerated;
if (boundConversion.ConversionKind == CSharp.ConversionKind.MethodGroup) if (boundConversion.ConversionKind == CSharp.ConversionKind.MethodGroup)
{ {
......
...@@ -124,53 +124,6 @@ private ImmutableArray<IOperation> GetAnonymousObjectCreationInitializers(BoundA ...@@ -124,53 +124,6 @@ private ImmutableArray<IOperation> GetAnonymousObjectCreationInitializers(BoundA
return builder.ToImmutableAndFree(); return builder.ToImmutableAndFree();
} }
private static ConversionKind GetConversionKind(CSharp.ConversionKind kind)
{
switch (kind)
{
case CSharp.ConversionKind.ExplicitUserDefined:
case CSharp.ConversionKind.ImplicitUserDefined:
return Semantics.ConversionKind.OperatorMethod;
case CSharp.ConversionKind.ExplicitReference:
case CSharp.ConversionKind.ImplicitReference:
case CSharp.ConversionKind.Boxing:
case CSharp.ConversionKind.Unboxing:
case CSharp.ConversionKind.Identity:
return Semantics.ConversionKind.Cast;
case CSharp.ConversionKind.AnonymousFunction:
case CSharp.ConversionKind.ExplicitDynamic:
case CSharp.ConversionKind.ImplicitDynamic:
case CSharp.ConversionKind.ExplicitEnumeration:
case CSharp.ConversionKind.ImplicitEnumeration:
case CSharp.ConversionKind.ImplicitThrow:
case CSharp.ConversionKind.ImplicitTupleLiteral:
case CSharp.ConversionKind.ImplicitTuple:
case CSharp.ConversionKind.ExplicitTupleLiteral:
case CSharp.ConversionKind.ExplicitTuple:
case CSharp.ConversionKind.ExplicitNullable:
case CSharp.ConversionKind.ImplicitNullable:
case CSharp.ConversionKind.ExplicitNumeric:
case CSharp.ConversionKind.ImplicitNumeric:
case CSharp.ConversionKind.ImplicitConstant:
case CSharp.ConversionKind.IntegerToPointer:
case CSharp.ConversionKind.IntPtr:
case CSharp.ConversionKind.DefaultOrNullLiteral:
case CSharp.ConversionKind.NullToPointer:
case CSharp.ConversionKind.PointerToInteger:
case CSharp.ConversionKind.PointerToPointer:
case CSharp.ConversionKind.PointerToVoid:
return Semantics.ConversionKind.CSharp;
case CSharp.ConversionKind.InterpolatedString:
return Semantics.ConversionKind.InterpolatedString;
default:
return Semantics.ConversionKind.Invalid;
}
}
private static ITypeSymbol GetArrayCreationElementType(BoundArrayCreation creation) private static ITypeSymbol GetArrayCreationElementType(BoundArrayCreation creation)
{ {
IArrayTypeSymbol arrayType = creation.Type as IArrayTypeSymbol; IArrayTypeSymbol arrayType = creation.Type as IArrayTypeSymbol;
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.Semantics
{
/// <summary>
/// Kinds of conversions.
/// </summary>
public enum ConversionKind
{
None = 0x0,
/// <summary>
/// Conversion is defined by the underlying type system and throws an exception if it fails.
/// </summary>
Cast = 0x1,
/// <summary>
/// Conversion is defined by the underlying type system and produces a null result if it fails.
/// </summary>
TryCast = 0x2,
/// <summary>
/// Conversion has VB-specific semantics.
/// </summary>
Basic = 0x3,
/// <summary>
/// Conversion has C#-specific semantics.
/// </summary>
CSharp = 0x4,
/// <summary>
/// Conversion is implemented by a conversion operator method.
/// </summary>
OperatorMethod = 0x5,
/// <summary>
/// Conversion is defined by the underlying type, and is created when an interpolated
/// string expression is being converted to an IFormattable or FormattableString.
/// </summary>
InterpolatedString = 0x6,
/// <summary>
/// Conversion is invalid.
/// </summary>
Invalid = 0xf
}
}
...@@ -187,15 +187,6 @@ Microsoft.CodeAnalysis.Semantics.CommonConversion.IsNumeric.get -> bool ...@@ -187,15 +187,6 @@ Microsoft.CodeAnalysis.Semantics.CommonConversion.IsNumeric.get -> bool
Microsoft.CodeAnalysis.Semantics.CommonConversion.IsReference.get -> bool Microsoft.CodeAnalysis.Semantics.CommonConversion.IsReference.get -> bool
Microsoft.CodeAnalysis.Semantics.CommonConversion.IsUserDefined.get -> bool Microsoft.CodeAnalysis.Semantics.CommonConversion.IsUserDefined.get -> bool
Microsoft.CodeAnalysis.Semantics.CommonConversion.MethodSymbol.get -> Microsoft.CodeAnalysis.IMethodSymbol Microsoft.CodeAnalysis.Semantics.CommonConversion.MethodSymbol.get -> Microsoft.CodeAnalysis.IMethodSymbol
Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.ConversionKind.Basic = 3 -> Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.ConversionKind.CSharp = 4 -> Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.ConversionKind.Cast = 1 -> Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.ConversionKind.InterpolatedString = 6 -> Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.ConversionKind.Invalid = 15 -> Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.ConversionKind.None = 0 -> Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.ConversionKind.OperatorMethod = 5 -> Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.ConversionKind.TryCast = 2 -> Microsoft.CodeAnalysis.Semantics.ConversionKind
Microsoft.CodeAnalysis.Semantics.IAddressOfExpression Microsoft.CodeAnalysis.Semantics.IAddressOfExpression
Microsoft.CodeAnalysis.Semantics.IAddressOfExpression.Reference.get -> Microsoft.CodeAnalysis.IOperation Microsoft.CodeAnalysis.Semantics.IAddressOfExpression.Reference.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression Microsoft.CodeAnalysis.Semantics.IAnonymousObjectCreationExpression
......
...@@ -507,7 +507,7 @@ Namespace Microsoft.CodeAnalysis.Semantics ...@@ -507,7 +507,7 @@ Namespace Microsoft.CodeAnalysis.Semantics
Private Function CreateBoundTryCastOperation(boundTryCast As BoundTryCast) As IConversionExpression Private Function CreateBoundTryCastOperation(boundTryCast As BoundTryCast) As IConversionExpression
Dim operand As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundTryCast.Operand)) Dim operand As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundTryCast.Operand))
Dim syntax As SyntaxNode = boundTryCast.Syntax Dim syntax As SyntaxNode = boundTryCast.Syntax
Dim conversion As Conversion = New Conversion(New KeyValuePair(Of VisualBasic.ConversionKind, MethodSymbol)(boundTryCast.ConversionKind, Nothing)) Dim conversion As Conversion = New Conversion(New KeyValuePair(Of ConversionKind, MethodSymbol)(boundTryCast.ConversionKind, Nothing))
Dim isExplicitCastInCode As Boolean = True Dim isExplicitCastInCode As Boolean = True
Dim isTryCast As Boolean = True Dim isTryCast As Boolean = True
Dim isChecked As Boolean = False Dim isChecked As Boolean = False
...@@ -520,7 +520,7 @@ Namespace Microsoft.CodeAnalysis.Semantics ...@@ -520,7 +520,7 @@ Namespace Microsoft.CodeAnalysis.Semantics
Private Function CreateBoundDirectCastOperation(boundDirectCast As BoundDirectCast) As IConversionExpression Private Function CreateBoundDirectCastOperation(boundDirectCast As BoundDirectCast) As IConversionExpression
Dim operand As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundDirectCast.Operand)) Dim operand As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundDirectCast.Operand))
Dim syntax As SyntaxNode = boundDirectCast.Syntax Dim syntax As SyntaxNode = boundDirectCast.Syntax
Dim conversion As Conversion = New Conversion(New KeyValuePair(Of VisualBasic.ConversionKind, MethodSymbol)(boundDirectCast.ConversionKind, Nothing)) Dim conversion As Conversion = New Conversion(New KeyValuePair(Of ConversionKind, MethodSymbol)(boundDirectCast.ConversionKind, Nothing))
Dim isExplicit As Boolean = True Dim isExplicit As Boolean = True
Dim isTryCast As Boolean = False Dim isTryCast As Boolean = False
Dim isChecked As Boolean = False Dim isChecked As Boolean = False
...@@ -543,7 +543,7 @@ Namespace Microsoft.CodeAnalysis.Semantics ...@@ -543,7 +543,7 @@ Namespace Microsoft.CodeAnalysis.Semantics
operand = New Lazy(Of IOperation)(Function() Create(boundConversion.Operand)) operand = New Lazy(Of IOperation)(Function() Create(boundConversion.Operand))
End If End If
Dim conversion = New Conversion(New KeyValuePair(Of VisualBasic.ConversionKind, MethodSymbol)(boundConversion.ConversionKind, methodSymbol)) Dim conversion = New Conversion(New KeyValuePair(Of ConversionKind, MethodSymbol)(boundConversion.ConversionKind, methodSymbol))
Dim syntax As SyntaxNode = boundConversion.Syntax Dim syntax As SyntaxNode = boundConversion.Syntax
Dim isExplicit As Boolean = boundConversion.ExplicitCastInCode Dim isExplicit As Boolean = boundConversion.ExplicitCastInCode
Dim isTryCast As Boolean = False Dim isTryCast As Boolean = False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册