diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests.cs index 2c5093f2040279163128b4a127d2a6ad4c7ac7c2..2b030f75280c07dedefd50dab276e15f9ae60efa 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests.cs @@ -48,7 +48,8 @@ static void Test2(int y, params int[] x) Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'null') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Int32[], Constant: null) (Syntax: 'null') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32[], Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') InConversion: null OutConversion: null"); diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IArgument.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IArgument.cs index 524f0987001b676c2070c303d5c245fdc1438f7d..a6d51d8dcc32c21e94369355d35980abbd3929da 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IArgument.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IArgument.cs @@ -239,7 +239,7 @@ static void M1() static void M2(int x = 1, int y = 2, int z = 3) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'M2(9, z: 10);') Expression: IInvocationExpression (void P.M2([System.Int32 x = 1], [System.Int32 y = 2], [System.Int32 z = 3])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(9, z: 10)') Instance Receiver: null @@ -508,7 +508,7 @@ public static void E1(this P p, int x = 0, int y = 0) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'this.E1(y: 1, x: 2);') Expression: IInvocationExpression (void Extensions.E1(this P p, [System.Int32 x = 0], [System.Int32 y = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'this.E1(y: 1, x: 2)') Instance Receiver: null @@ -762,7 +762,7 @@ void M1() void M2(int x = 0, params double[] array) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(array: 1)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') Arguments(2): @@ -772,7 +772,8 @@ void M1() ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'M2(array: 1)') Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: 'M2(array: 1)') Element Values(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null @@ -833,7 +834,7 @@ void M1() void M2(int x = 0, params double[] array) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, array: 1)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') Arguments(2): @@ -847,7 +848,8 @@ void M1() ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'M2(1, array: 1)') Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: 'M2(1, array: 1)') Element Values(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null @@ -872,7 +874,7 @@ void M1() void M2(int x = 0, params double[] array) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'M2(array: a, x: 1);') Expression: IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(array: a, x: 1)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') @@ -905,7 +907,7 @@ void M1() void M2(int x = 0, params double[] array) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(array: 1, x: 10)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') Arguments(2): @@ -915,7 +917,8 @@ void M1() ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'M2(array: 1, x: 10)') Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer) (Syntax: 'M2(array: 1, x: 10)') Element Values(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null @@ -1121,7 +1124,7 @@ void M2(int x = 0) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0])) (OperationKind.InvocationExpression, Type: System.Void, IsInvalid) (Syntax: 'M2(1, 2)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P, IsInvalid) (Syntax: 'M2') Arguments(2): @@ -1158,7 +1161,7 @@ void M2(string x ) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( void P.M2(System.String x)) (OperationKind.InvocationExpression, Type: System.Void, IsInvalid) (Syntax: 'M2(1)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') Arguments(1): @@ -1191,7 +1194,7 @@ void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression (void System.Console.Write(System.String format, System.Object arg0, System.Object arg1, System.Object arg2, System.Object arg3, __arglist)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... arglist(5))') Instance Receiver: null Arguments(6): @@ -1200,22 +1203,26 @@ void M() InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: arg0) (OperationKind.Argument) (Syntax: '1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: arg1) (OperationKind.Argument) (Syntax: '2') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: arg2) (OperationKind.Argument) (Syntax: '3') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: arg3) (OperationKind.Argument) (Syntax: '4') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '4') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '4') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') InConversion: null OutConversion: null @@ -1246,7 +1253,7 @@ void M2(int x = ""string"") { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = default(System.Int32)])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') Arguments(1): @@ -1386,7 +1393,7 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IPropertyReferenceExpression: System.Int32 P.this[System.Int32 index] { set; } (OperationKind.PropertyReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'this[10]') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: P, IsInvalid) (Syntax: 'this') Arguments(1): @@ -1395,7 +1402,7 @@ void M1() InConversion: null OutConversion: null "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // file.cs(12,27): error CS0154: The property or indexer 'P.this[int]' cannot be used in this context because it lacks the get accessor // var x = /**/this[10]/**/; Diagnostic(ErrorCode.ERR_PropertyLacksGet, "this[10]").WithArguments("P.this[int]").WithLocation(12, 27) @@ -1422,7 +1429,7 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IPropertyReferenceExpression: System.Int32 P.this[System.Int32 index] { get; } (OperationKind.PropertyReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'this[10]') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: P, IsInvalid) (Syntax: 'this') Arguments(1): @@ -1611,8 +1618,8 @@ .locals init ([0] int32 V_0) IL_0021: ldloc.0 IL_0022: ret } // end of method P::get_Item - - .method public hidebysig specialname instance void + + .method public hidebysig specialname instance void set_Item([opt] int32 i, [opt] int32 j, int32 'value') cil managed @@ -1727,12 +1734,12 @@ .locals init ([0] int32 V_0) IL_0021: ldloc.0 IL_0022: ret } // end of method P::get_Item - - .method public hidebysig specialname instance void + + .method public hidebysig specialname instance void set_Item([opt] int32 i, [opt] int32 j, int32 'value') cil managed - { + { .param [1] = int32(0x00000003) .param [2] = int32(0x00000004) // Code size 30 (0x1e) @@ -1844,12 +1851,12 @@ .locals init ([0] int32 V_0) IL_0021: ldloc.0 IL_0022: ret } // end of method P::get_Item - - .method public hidebysig specialname instance void + + .method public hidebysig specialname instance void set_Item([opt] int32 i, [opt] int32 j, int32 'value') cil managed - { + { .param [1] = int32(0x00000003) .param [2] = int32(0x00000004) // Code size 30 (0x1e) @@ -1941,7 +1948,7 @@ .maxstack 8 IL_0000: nop IL_0001: ret } // end of method P::M1 -} // end of class P +} // end of class P "; var csharp = @" @@ -1954,12 +1961,13 @@ public void M2() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( void P.M1([System.Int32 s = ""abc""])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'p.M1()') Instance Receiver: ILocalReferenceExpression: p (OperationKind.LocalReferenceExpression, Type: P) (Syntax: 'p') Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: s) (OperationKind.Argument) (Syntax: 'p.M1()') - IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: 'p.M1()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: 'p.M1()') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""abc"") (Syntax: 'p.M1()') InConversion: null OutConversion: null @@ -1985,13 +1993,13 @@ static void M2(bool? x = null) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression (void P.M2([System.Boolean[missing]? x = null])) (OperationKind.InvocationExpression, Type: System.Void[missing], IsInvalid) (Syntax: 'M2()') Instance Receiver: null Arguments(0) "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // (3,7): error CS0518: Predefined type 'System.Object' is not defined or imported // class P Diagnostic(ErrorCode.ERR_PredefinedTypeNotFound, "P").WithArguments("System.Object").WithLocation(2, 7), @@ -2035,7 +2043,7 @@ static void M2(int x, S s = 0) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression (void P.M2(System.Int32 x, [S s = null])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1)') Instance Receiver: null Arguments(1): @@ -2045,7 +2053,7 @@ static void M2(int x, S s = 0) OutConversion: null "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // file.cs(9,27): error CS0246: The type or namespace name 'S' could not be found (are you missing a using directive or an assembly reference?) // static void M2(int x, S s = 0) Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "S").WithArguments("S").WithLocation(9, 27), @@ -2094,7 +2102,7 @@ class G OutConversion: null "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // file.cs(9,29): error CS0246: The type or namespace name 'S' could not be found (are you missing a using directive or an assembly reference?) // static void M2(int x, G s = null) Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "S").WithArguments("S").WithLocation(9, 29) @@ -2140,7 +2148,7 @@ struct G OutConversion: null "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // file.cs(9,29): error CS0246: The type or namespace name 'S' could not be found (are you missing a using directive or an assembly reference?) // static void M2(int x, G s = null) Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "S").WithArguments("S").WithLocation(9, 29) diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IConversionExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IConversionExpression.cs index 8f35a080ada30bb13e295007e1d362210d456ab7..4976dd135c648b564ab33cc66e849836dbc875c7 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IConversionExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IConversionExpression.cs @@ -28,11 +28,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'dynamic /*< ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'dynamic /*< ... **/;') Variables: Local_1: dynamic d1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: dynamic) (Syntax: 'o1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: dynamic) (Syntax: 'o1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: o1 (OperationKind.LocalReferenceExpression, Type: System.Object) (Syntax: 'o1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -81,11 +82,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'double /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'double /**/;') Variables: Local_1: System.Double d1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Double) (Syntax: 'f1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Double) (Syntax: 'f1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: f1 (OperationKind.LocalReferenceExpression, Type: System.Single) (Syntax: 'f1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -107,11 +109,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'f1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'f1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: f1 (OperationKind.LocalReferenceExpression, Type: System.Single, IsInvalid) (Syntax: 'f1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -170,11 +173,12 @@ enum Enum1 Option1, Option2 } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Enum1 /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Enum1 /**/;') Variables: Local_1: Enum1 e1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: Enum1, Constant: 0) (Syntax: '0') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Enum1, Constant: 0) (Syntax: '0') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -204,11 +208,12 @@ enum Enum1 Option1, Option2 } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Enum1 /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Enum1 /**/;') Variables: Local_1: Enum1 e1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: Enum1, IsInvalid) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Enum1, IsInvalid) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'i1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -236,11 +241,12 @@ enum Enum1 Option1, Option2 } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Enum1 /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Enum1 /**/;') Variables: Local_1: Enum1 e1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: Enum1, IsInvalid) (Syntax: '1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Enum1, IsInvalid) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: '1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -300,7 +306,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'object /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'object /**/;') Variables: Local_1: System.Object o @@ -308,7 +314,8 @@ static void Main(string[] args) Left: IObjectCreationExpression (Constructor: System.Object..ctor()) (OperationKind.ObjectCreationExpression, Type: System.Object) (Syntax: 'new object()') Arguments(0) Initializer: null - Right: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'throw new Exception()') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'throw new Exception()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IThrowExpression (OperationKind.ThrowExpression, Type: null) (Syntax: 'throw new Exception()') IObjectCreationExpression (Constructor: System.Exception..ctor()) (OperationKind.ObjectCreationExpression, Type: System.Exception) (Syntax: 'new Exception()') Arguments(0) @@ -377,11 +384,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'string /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'string /**/;') Variables: Local_1: System.String s1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -410,11 +418,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'S1? /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'S1? /**/;') Variables: Local_1: S1? s1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: S1?, Constant: null) (Syntax: 'null') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: S1?, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -439,11 +448,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'null') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'null') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null, IsInvalid) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -470,11 +480,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'long /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'long /**/;') Variables: Local_1: System.Int64 i1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 0) (Syntax: 'default') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 0) (Syntax: 'default') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IDefaultValueExpression (OperationKind.DefaultValueExpression, Type: System.Int64, Constant: 0) (Syntax: 'default') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -502,11 +513,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'long /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'long /**/;') Variables: Local_1: System.Int64 i1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 0) (Syntax: 'default(int)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 0) (Syntax: 'default(int)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IDefaultValueExpression (OperationKind.DefaultValueExpression, Type: System.Int32, Constant: 0) (Syntax: 'default(int)') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -563,11 +575,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int? /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int? /**/;') Variables: Local_1: System.Int32? i1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32?) (Syntax: '1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32?) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -593,11 +606,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'long? /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'long? /**/;') Variables: Local_1: System.Int64? l1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64?) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64?) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32?) (Syntax: 'i1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -619,11 +633,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int? /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int? /**/;') Variables: Local_1: System.Int32? i2 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32?) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32?) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -645,11 +660,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i2 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32?, IsInvalid) (Syntax: 'i1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -677,11 +693,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'IFormattabl ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'IFormattabl ... **/;') Variables: Local_1: System.IFormattable f1 - Initializer: IConversionExpression (ConversionKind.InterpolatedString, Implicit) (OperationKind.ConversionExpression, Type: System.IFormattable) (Syntax: '$""{1}""') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.IFormattable) (Syntax: '$""{1}""') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInterpolatedStringExpression (OperationKind.InterpolatedStringExpression, Type: System.String) (Syntax: '$""{1}""') Parts(1): IInterpolation (OperationKind.Interpolation) (Syntax: '{1}') @@ -709,11 +726,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'object /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'object /**/;') Variables: Local_1: System.Object o1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'new C1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'new C1()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: C1..ctor()) (OperationKind.ObjectCreationExpression, Type: C1) (Syntax: 'new C1()') Arguments(0) Initializer: null @@ -738,11 +756,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'dynamic /*< ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'dynamic /*< ... **/;') Variables: Local_1: dynamic d1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: dynamic) (Syntax: 'new C1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: dynamic) (Syntax: 'new C1()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: C1..ctor()) (OperationKind.ObjectCreationExpression, Type: C1) (Syntax: 'new C1()') Arguments(0) Initializer: null @@ -771,11 +790,12 @@ class C2 : C1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: C1) (Syntax: 'new C2()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1) (Syntax: 'new C2()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: C2..ctor()) (OperationKind.ObjectCreationExpression, Type: C2) (Syntax: 'new C2()') Arguments(0) Initializer: null @@ -804,11 +824,12 @@ class C2 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: 'new C2()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: 'new C2()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: C2..ctor()) (OperationKind.ObjectCreationExpression, Type: C2, IsInvalid) (Syntax: 'new C2()') Arguments(0) Initializer: null @@ -837,11 +858,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: 'new/**/') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: 'new/**/') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'new/**/') Children(0) "; @@ -876,11 +898,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'new C1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'new C1()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: C1..ctor()) (OperationKind.ObjectCreationExpression, Type: C1) (Syntax: 'new C1()') Arguments(0) Initializer: null @@ -909,11 +932,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'new C1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'new C1()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: C1..ctor()) (OperationKind.ObjectCreationExpression, Type: C1, IsInvalid) (Syntax: 'new C1()') Arguments(0) Initializer: null @@ -946,11 +970,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: 'new I1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: 'new I1()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: I1, IsInvalid) (Syntax: 'new I1()') Children(0) "; @@ -987,11 +1012,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'i2') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'i2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i2 (OperationKind.LocalReferenceExpression, Type: I2) (Syntax: 'i2') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1023,11 +1049,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'i2') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'i2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i2 (OperationKind.LocalReferenceExpression, Type: I2, IsInvalid) (Syntax: 'i2') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -1059,11 +1086,12 @@ class C2 : C1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C1[] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C1[] /**/;') Variables: Local_1: C1[] c1arr - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: C1[]) (Syntax: 'c2arr') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1[]) (Syntax: 'c2arr') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2arr (OperationKind.LocalReferenceExpression, Type: C2[]) (Syntax: 'c2arr') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1091,11 +1119,12 @@ class C2 : C1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1[][] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1[][] /**/;') Variables: Local_1: C1[][] c1arr - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: C1[][], IsInvalid) (Syntax: 'c2arr') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1[][], IsInvalid) (Syntax: 'c2arr') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2arr (OperationKind.LocalReferenceExpression, Type: C2[], IsInvalid) (Syntax: 'c2arr') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -1127,11 +1156,12 @@ class C2 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1[] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1[] /**/;') Variables: Local_1: C1[] c1arr - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: C1[], IsInvalid) (Syntax: 'c2arr') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1[], IsInvalid) (Syntax: 'c2arr') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2arr (OperationKind.LocalReferenceExpression, Type: C2[], IsInvalid) (Syntax: 'c2arr') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -1166,11 +1196,12 @@ struct S1 : I1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I1[] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I1[] /**/;') Variables: Local_1: I1[] i1arr - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: I1[], IsInvalid) (Syntax: 'new S1[10]') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1[], IsInvalid) (Syntax: 'new S1[10]') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: S1) (OperationKind.ArrayCreationExpression, Type: S1[], IsInvalid) (Syntax: 'new S1[10]') Dimension Sizes(1): ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10, IsInvalid) (Syntax: '10') @@ -1200,11 +1231,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Array /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Array /**/;') Variables: Local_1: System.Array a1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Array) (Syntax: 'new object[10]') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Array) (Syntax: 'new object[10]') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Object) (OperationKind.ArrayCreationExpression, Type: System.Object[]) (Syntax: 'new object[10]') Dimension Sizes(1): ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') @@ -1230,11 +1262,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Array /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Array /**/;') Variables: Local_1: System.Array a1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Array) (Syntax: 'new int[10][]') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Array) (Syntax: 'new int[10][]') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32[]) (OperationKind.ArrayCreationExpression, Type: System.Int32[][]) (Syntax: 'new int[10][]') Dimension Sizes(1): ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') @@ -1260,11 +1293,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Array /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Array /**/;') Variables: Local_1: System.Array a1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Array, IsInvalid) (Syntax: 'new object()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Array, IsInvalid) (Syntax: 'new object()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: System.Object..ctor()) (OperationKind.ObjectCreationExpression, Type: System.Object, IsInvalid) (Syntax: 'new object()') Arguments(0) Initializer: null @@ -1293,11 +1327,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'IList ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'IList ... **/;') Variables: Local_1: System.Collections.Generic.IList a1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList) (Syntax: 'new int[10]') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList) (Syntax: 'new int[10]') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new int[10]') Dimension Sizes(1): ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') @@ -1323,11 +1358,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'IList ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'IList ... **/;') Variables: Local_1: System.Collections.Generic.IList a1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList, IsInvalid) (Syntax: 'new object()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList, IsInvalid) (Syntax: 'new object()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: System.Object..ctor()) (OperationKind.ObjectCreationExpression, Type: System.Object, IsInvalid) (Syntax: 'new object()') Arguments(0) Initializer: null @@ -1362,11 +1398,12 @@ void M2() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Delegate /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Delegate /* ... **/;') Variables: Local_1: System.Delegate d2 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Delegate) (Syntax: 'd1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Delegate) (Syntax: 'd1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: d1 (OperationKind.LocalReferenceExpression, Type: C1.DType) (Syntax: 'd1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1395,11 +1432,12 @@ void M2() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Delegate /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Delegate /* ... **/;') Variables: Local_1: System.Delegate d2 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Delegate, IsInvalid) (Syntax: 'd1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Delegate, IsInvalid) (Syntax: 'd1()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression (virtual void C1.DType.Invoke()) (OperationKind.InvocationExpression, Type: System.Void, IsInvalid) (Syntax: 'd1()') Instance Receiver: ILocalReferenceExpression: d1 (OperationKind.LocalReferenceExpression, Type: C1.DType, IsInvalid) (Syntax: 'd1') Arguments(0) @@ -1493,11 +1531,12 @@ void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'DType /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'DType /**/;') Variables: Local_1: Program.DType d1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: Program.DType, IsInvalid) (Syntax: 'M1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Program.DType, IsInvalid) (Syntax: 'M1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'M1') Children(0) "; @@ -1526,11 +1565,12 @@ void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'DType /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'DType /**/;') Variables: Local_1: Program.DType d1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: Program.DType) (Syntax: '() => { }') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Program.DType) (Syntax: '() => { }') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '() => { }') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ }') IReturnStatement (OperationKind.ReturnStatement) (Syntax: '{ }') @@ -1555,11 +1595,12 @@ void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'DType /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'DType /**/;') Variables: Local_1: Program.DType d1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: Program.DType, IsInvalid) (Syntax: '(string s) => { }') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Program.DType, IsInvalid) (Syntax: '(string s) => { }') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '(string s) => { }') IBlockStatement (0 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '{ }') "; @@ -1587,11 +1628,12 @@ void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'DType /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'DType /**/;') Variables: Local_1: Program.DType d1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: Program.DType, IsInvalid) (Syntax: '() =>/**/') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Program.DType, IsInvalid) (Syntax: '() =>/**/') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '() =>/**/') IBlockStatement (2 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '') IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: '') @@ -1628,7 +1670,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'new Action(() => { })') Children(1): ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '() => { }') @@ -1662,11 +1704,12 @@ class C3 : C2 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: C1) (Syntax: 'new C3()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1) (Syntax: 'new C3()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: C3..ctor()) (OperationKind.ObjectCreationExpression, Type: C3) (Syntax: 'new C3()') Arguments(0) Initializer: null @@ -1706,11 +1749,12 @@ class C4 : C3 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /**/;') Variables: Local_1: I1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'c2') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: C2) (Syntax: 'c2') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1748,11 +1792,12 @@ class C4 : C3 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I1 /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I1 /**/;') Variables: Local_1: I1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'c2') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: C2, IsInvalid) (Syntax: 'c2') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -1794,11 +1839,12 @@ class C4 : C3 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /**/;') Variables: Local_1: I1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'c2') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: C2) (Syntax: 'c2') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1836,11 +1882,12 @@ class C4 : C3 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I1 /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I1 /**/;') Variables: Local_1: I1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'c2') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'c2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: C2, IsInvalid) (Syntax: 'c2') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -1867,11 +1914,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'IList*/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'IList*/;') Variables: Local_1: System.Collections.Generic.IList list - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList) (Syntax: 'new List()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList) (Syntax: 'new List()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: System.Collections.Generic.List..ctor()) (OperationKind.ObjectCreationExpression, Type: System.Collections.Generic.List) (Syntax: 'new List()') Arguments(0) Initializer: null @@ -1900,11 +1948,12 @@ class C2 : C1 } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: C1) (Syntax: 'new T()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1) (Syntax: 'new T()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ITypeParameterObjectCreationExpression (OperationKind.TypeParameterObjectCreationExpression, Type: T) (Syntax: 'new T()') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1931,11 +1980,12 @@ class C2 : C1 } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: 'new T()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: 'new T()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITypeParameterObjectCreationExpression (OperationKind.TypeParameterObjectCreationExpression, Type: T, IsInvalid) (Syntax: 'new T()') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -1965,11 +2015,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'new T()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'new T()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ITypeParameterObjectCreationExpression (OperationKind.TypeParameterObjectCreationExpression, Type: T) (Syntax: 'new T()') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -1995,11 +2046,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'new T()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'new T()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ITypeParameterObjectCreationExpression (OperationKind.TypeParameterObjectCreationExpression, Type: T, IsInvalid) (Syntax: 'new T()') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2030,11 +2082,12 @@ class C1 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'U /** ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'U /** ... **/;') Variables: Local_1: U u - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: U) (Syntax: 'new T()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: U) (Syntax: 'new T()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITypeParameterObjectCreationExpression (OperationKind.TypeParameterObjectCreationExpression, Type: T) (Syntax: 'new T()') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2061,11 +2114,12 @@ class C1 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'U /** ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'U /** ... **/;') Variables: Local_1: U u - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: U, IsInvalid) (Syntax: 'new T()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: U, IsInvalid) (Syntax: 'new T()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITypeParameterObjectCreationExpression (OperationKind.TypeParameterObjectCreationExpression, Type: T, IsInvalid) (Syntax: 'new T()') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2095,11 +2149,12 @@ class C1 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'T /** ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'T /** ... **/;') Variables: Local_1: T t - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: T, Constant: null) (Syntax: 'null') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: T, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2129,11 +2184,12 @@ class C1 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'T /** ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'T /** ... **/;') Variables: Local_1: T t - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: T, IsInvalid) (Syntax: 'null') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: T, IsInvalid) (Syntax: 'null') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null, IsInvalid) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2160,11 +2216,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'object /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'object /**/;') Variables: Local_1: System.Object o - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'i') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2187,11 +2244,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'dynamic /*< ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'dynamic /*< ... **/;') Variables: Local_1: dynamic d - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: dynamic) (Syntax: 'i') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: dynamic) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2215,11 +2273,12 @@ void M1() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'ValueType / ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'ValueType / ... **/;') Variables: Local_1: System.ValueType v1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.ValueType) (Syntax: 'new S1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.ValueType) (Syntax: 'new S1()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: S1..ctor()) (OperationKind.ObjectCreationExpression, Type: S1) (Syntax: 'new S1()') Arguments(0) Initializer: null @@ -2245,11 +2304,12 @@ void M1() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'ValueType / ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'ValueType / ... **/;') Variables: Local_1: System.ValueType v1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.ValueType, IsInvalid) (Syntax: 'new C1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.ValueType, IsInvalid) (Syntax: 'new C1()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: C1..ctor()) (OperationKind.ObjectCreationExpression, Type: C1, IsInvalid) (Syntax: 'new C1()') Arguments(0) Initializer: null @@ -2280,11 +2340,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'new S1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: 'new S1()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: S1..ctor()) (OperationKind.ObjectCreationExpression, Type: S1) (Syntax: 'new S1()') Arguments(0) Initializer: null @@ -2311,11 +2372,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'new S1()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 'new S1()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: S1..ctor()) (OperationKind.ObjectCreationExpression, Type: S1, IsInvalid) (Syntax: 'new S1()') Arguments(0) Initializer: null @@ -2347,11 +2409,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: 's1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: 's1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: s1 (OperationKind.LocalReferenceExpression, Type: S1?) (Syntax: 's1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2377,11 +2440,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 's1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1, IsInvalid) (Syntax: 's1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: s1 (OperationKind.LocalReferenceExpression, Type: S1?, IsInvalid) (Syntax: 's1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2414,11 +2478,12 @@ void M1() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Enum /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Enum /**/;') Variables: Local_1: System.Enum e - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Enum) (Syntax: 'E1.E') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Enum) (Syntax: 'E1.E') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: E1.E (Static) (OperationKind.FieldReferenceExpression, Type: E1, Constant: 0) (Syntax: 'E1.E') Instance Receiver: null "; @@ -2448,11 +2513,12 @@ void M1() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Enum /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Enum /**/;') Variables: Local_1: System.Enum e - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Enum, IsInvalid) (Syntax: '1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Enum, IsInvalid) (Syntax: '1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: '1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2478,11 +2544,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'string /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'string /**/;') Variables: Local_1: System.String s1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'd1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'd1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: d1 (OperationKind.LocalReferenceExpression, Type: dynamic) (Syntax: 'd1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2504,11 +2571,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: 'd1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: 'd1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: d1 (OperationKind.LocalReferenceExpression, Type: dynamic) (Syntax: 'd1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2530,11 +2598,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'const sbyte ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'const sbyte ... **/;') Variables: Local_1: System.SByte s1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.SByte, Constant: 1) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.SByte, Constant: 1) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32, Constant: 1) (Syntax: 'i1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2560,11 +2629,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const sbyte ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'const sbyte ... **/;') Variables: Local_1: System.SByte s1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.SByte, IsInvalid) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.SByte, IsInvalid) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32, Constant: 4096, IsInvalid) (Syntax: 'i1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2590,11 +2660,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const sbyte ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'const sbyte ... **/;') Variables: Local_1: System.SByte s1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.SByte, IsInvalid) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.SByte, IsInvalid) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'i1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2627,11 +2698,12 @@ class C2 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C2 /* ... **/;') Variables: Local_1: C2 c2 - Initializer: IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: C2 C2.op_Implicit(C1 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: 'this') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: C2 C2.op_Implicit(C1 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: 'this') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C2 C2.op_Implicit(C1 c1)) Operand: IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: C1) (Syntax: 'this') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2661,12 +2733,14 @@ class C2 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C2 /* ... **/;') Variables: Local_1: C2 c2 - Initializer: IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: C2 C2.op_Implicit(System.Int64 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: 'i1') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: C2 C2.op_Implicit(System.Int64 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C2 C2.op_Implicit(System.Int64 c1)) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: C2 C2.op_Implicit(System.Int64 c1)) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C2 C2.op_Implicit(System.Int64 c1)) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2704,13 +2778,16 @@ class C2 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C2 /* ... **/;') Variables: Local_1: C2 c2 - Initializer: IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: C2 C2.op_Implicit(System.Int64 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(int)this') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: '(int)this') - Operand: IConversionExpression (ConversionKind.OperatorMethod, Explicit) (OperatorMethod: System.Int32 C1.op_Implicit(C1 c1)) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)this') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: C2 C2.op_Implicit(System.Int64 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(int)this') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C2 C2.op_Implicit(System.Int64 c1)) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: C2 C2.op_Implicit(System.Int64 c1)) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: '(int)this') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C2 C2.op_Implicit(System.Int64 c1)) + Operand: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperatorMethod: C2 C2.op_Implicit(System.Int64 c1)) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)this') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C2 C2.op_Implicit(System.Int64 c1)) Operand: IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: C1) (Syntax: 'this') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2748,11 +2825,12 @@ class C2 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C2 /* ... **/;') Variables: Local_1: C2 c2 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: C2, IsInvalid) (Syntax: 'this') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C2, IsInvalid) (Syntax: 'this') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: C1, IsInvalid) (Syntax: 'this') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -2796,11 +2874,12 @@ class C3 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C3 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C3 /* ... **/;') Variables: Local_1: C3 c3 - Initializer: IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: C3 C3.op_Implicit(C2 c2)) (OperationKind.ConversionExpression, Type: C3) (Syntax: 'this') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: C3 C3.op_Implicit(C2 c2)) (OperationKind.ConversionExpression, Type: C3) (Syntax: 'this') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C3 C3.op_Implicit(C2 c2)) Operand: IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: C2) (Syntax: 'this') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2823,11 +2902,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Action /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Action /**/;') Variables: Local_1: System.Action a - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: 'delegate { }') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: 'delegate { }') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'delegate { }') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ }') IReturnStatement (OperationKind.ReturnStatement) (Syntax: '{ }') @@ -2853,11 +2933,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Action ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Action ... **/;') Variables: Local_1: System.Action a - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: 'delegate(int i) { }') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: 'delegate(int i) { }') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'delegate(int i) { }') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ }') IReturnStatement (OperationKind.ReturnStatement) (Syntax: '{ }') @@ -2883,11 +2964,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Action ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Action ... **/;') Variables: Local_1: System.Action a - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: 'delegate() { }') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: 'delegate() { }') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'delegate() { }') IBlockStatement (0 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '{ }') "; @@ -2915,11 +2997,12 @@ unsafe void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'void* /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'void* /**/;') Variables: Local_1: System.Void* v1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Void*) (Syntax: 'null') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Void*) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2943,11 +3026,12 @@ unsafe void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'void* /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'void* /**/;') Variables: Local_1: System.Void* v1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Void*) (Syntax: 'i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Void*) (Syntax: 'i1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: System.Int32*) (Syntax: 'i1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -2972,11 +3056,12 @@ unsafe void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int* /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'int* /**/;') Variables: Local_1: System.Int32* i1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32*, IsInvalid) (Syntax: 'v1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32*, IsInvalid) (Syntax: 'v1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: v1 (OperationKind.LocalReferenceExpression, Type: System.Void*, IsInvalid) (Syntax: 'v1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3004,11 +3089,12 @@ unsafe void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'void* /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'void* /**/;') Variables: Local_1: System.Void* v1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Void*, IsInvalid) (Syntax: '0') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Void*, IsInvalid) (Syntax: '0') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0, IsInvalid) (Syntax: '0') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3037,11 +3123,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Expression< ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Expression< ... **/;') Variables: Local_1: System.Linq.Expressions.Expression> exp - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Linq.Expressions.Expression>) (Syntax: 'num => num < 5') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Linq.Expressions.Expression>) (Syntax: 'num => num < 5') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'num => num < 5') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'num < 5') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'num < 5') @@ -3111,15 +3198,17 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Expression< ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Expression< ... **/;') Variables: Local_1: System.Linq.Expressions.Expression> exp - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Linq.Expressions.Expression>, IsInvalid) (Syntax: 'num =>/**/') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Linq.Expressions.Expression>, IsInvalid) (Syntax: 'num =>/**/') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'num =>/**/') IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '') IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: '') - ReturnedValue: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: '') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) "; @@ -3146,9 +3235,10 @@ public long M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'return i;') - ReturnedValue: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'i') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3170,9 +3260,10 @@ public int M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'return f;') - ReturnedValue: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'f') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'f') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: f (OperationKind.LocalReferenceExpression, Type: System.Single, IsInvalid) (Syntax: 'f') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3201,11 +3292,12 @@ public void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: '(int)1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: '(int)1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3230,12 +3322,14 @@ public void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'long /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'long /**/;') Variables: Local_1: System.Int64 i - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 1) (Syntax: '(int)1') - Operand: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: '(int)1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 1) (Syntax: '(int)1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: '(int)1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3260,8 +3354,9 @@ public void M1() } } "; -string expectedOperationTree = @" -IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: '(int)1.0') + string expectedOperationTree = @" +IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: '(int)1.0') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 1) (Syntax: '1.0') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3285,12 +3380,14 @@ public void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '(float)1.0') - Operand: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Single, Constant: 1, IsInvalid) (Syntax: '(float)1.0') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '(float)1.0') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Single, Constant: 1, IsInvalid) (Syntax: '(float)1.0') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 1, IsInvalid) (Syntax: '1.0') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3314,12 +3411,14 @@ public void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'long /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'long /**/;') Variables: Local_1: System.Int64 i - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, IsInvalid) (Syntax: '(int)/**/') - Operand: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '(int)/**/') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, IsInvalid) (Syntax: '(int)/**/') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '(int)/**/') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) "; @@ -3349,11 +3448,12 @@ enum E1 One, Two } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'E1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'E1 /* ... **/;') Variables: Local_1: E1 e1 - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: E1, Constant: 1) (Syntax: '(E1)1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: E1, Constant: 1) (Syntax: '(E1)1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3382,11 +3482,12 @@ enum E1 One, Two } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 0) (Syntax: '(int)E1.One') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 0) (Syntax: '(int)E1.One') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: E1.One (Static) (OperationKind.FieldReferenceExpression, Type: E1, Constant: 0) (Syntax: 'E1.One') Instance Receiver: null "; @@ -3421,11 +3522,12 @@ enum E2 Three, Four } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'E2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'E2 /* ... **/;') Variables: Local_1: E2 e2 - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: E2, Constant: 0) (Syntax: '(E2)E1.One') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: E2, Constant: 0) (Syntax: '(E2)E1.One') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: E1.One (Static) (OperationKind.FieldReferenceExpression, Type: E1, Constant: 0) (Syntax: 'E1.One') Instance Receiver: null "; @@ -3463,11 +3565,12 @@ enum E2 : byte // Note: The lack of a constant value for the conversion is expected here, it matches the semantic model. // Because the enum value is larger than the destination enum, the conversion is bad -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'E2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'E2 /* ... **/;') Variables: Local_1: E2 e2 - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: E2, Constant: null, IsInvalid) (Syntax: '(E2)E1.One') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: E2, Constant: null, IsInvalid) (Syntax: '(E2)E1.One') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: E1.One (Static) (OperationKind.FieldReferenceExpression, Type: E1, Constant: 1000, IsInvalid) (Syntax: 'E1.One') Instance Receiver: null "; @@ -3496,11 +3599,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int? /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int? /**/;') Variables: Local_1: System.Int32? i - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Int32?) (Syntax: '(int?)l') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32?) (Syntax: '(int?)l') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: l (OperationKind.LocalReferenceExpression, Type: System.Int64?) (Syntax: 'l') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3521,11 +3625,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)l') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)l') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: l (OperationKind.LocalReferenceExpression, Type: System.Int64?) (Syntax: 'l') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3546,11 +3651,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'string /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'string /**/;') Variables: Local_1: System.String s - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.String) (Syntax: '(string)o') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String) (Syntax: '(string)o') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: o (OperationKind.LocalReferenceExpression, Type: System.Object) (Syntax: 'o') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3571,11 +3677,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'string /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'string /**/;') Variables: Local_1: System.String s - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.String) (Syntax: '(string)d') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String) (Syntax: '(string)d') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: d (OperationKind.LocalReferenceExpression, Type: dynamic) (Syntax: 'd') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3600,11 +3707,12 @@ class C2 : C1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C2 /* ... **/;') Variables: Local_1: C2 c2 - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(C2)c1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(C2)c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: C1) (Syntax: 'c1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3629,11 +3737,12 @@ class C2 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C2 /* ... **/;') Variables: Local_1: C2 c2 - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: C2, IsInvalid) (Syntax: '(C2)c1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C2, IsInvalid) (Syntax: '(C2)c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: C1, IsInvalid) (Syntax: 'c1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3660,11 +3769,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: C1) (Syntax: '(C1)i1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1) (Syntax: '(C1)i1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: I1) (Syntax: 'i1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3687,11 +3797,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: C1) (Syntax: '(C1)i1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1) (Syntax: '(C1)i1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: I1) (Syntax: 'i1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3714,11 +3825,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1 /* ... **/;') Variables: Local_1: C1 c1 - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: '(C1)i1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1, IsInvalid) (Syntax: '(C1)i1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: I1, IsInvalid) (Syntax: 'i1') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3747,11 +3859,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I2 /* ... **/;') Variables: Local_1: I2 i2 - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: I2) (Syntax: '(I2)i1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I2) (Syntax: '(I2)i1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1 (OperationKind.LocalReferenceExpression, Type: I1) (Syntax: 'i1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3773,11 +3886,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'I2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'I2 /* ... **/;') Variables: Local_1: I2 i2 - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: I2, IsInvalid) (Syntax: '(I2)()') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I2, IsInvalid) (Syntax: '(I2)()') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) "; @@ -3805,11 +3919,12 @@ static void M1() class C2 : C1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C2[] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C2[] /**/;') Variables: Local_1: C2[] c2arr - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: C2[]) (Syntax: '(C2[])c1arr') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C2[]) (Syntax: '(C2[])c1arr') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1arr (OperationKind.LocalReferenceExpression, Type: C1[]) (Syntax: 'c1arr') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3832,11 +3947,12 @@ static void M1() class C2 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C2[] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C2[] /**/;') Variables: Local_1: C2[] c2arr - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: C2[], IsInvalid) (Syntax: '(C2[])c1arr') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C2[], IsInvalid) (Syntax: '(C2[])c1arr') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1arr (OperationKind.LocalReferenceExpression, Type: C1[], IsInvalid) (Syntax: 'c1arr') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3861,11 +3977,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1[][] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1[][] /**/;') Variables: Local_1: C1[][] c2arr - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: C1[][], IsInvalid) (Syntax: '(C1[][])c1arr') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1[][], IsInvalid) (Syntax: '(C1[][])c1arr') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1arr (OperationKind.LocalReferenceExpression, Type: C1[], IsInvalid) (Syntax: 'c1arr') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3892,11 +4009,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C1[] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C1[] /**/;') Variables: Local_1: C1[] c2arr - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: C1[]) (Syntax: '(C1[])c1arr') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1[]) (Syntax: '(C1[])c1arr') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1arr (OperationKind.LocalReferenceExpression, Type: System.Array) (Syntax: 'c1arr') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3920,11 +4038,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'IList / ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'IList / ... **/;') Variables: Local_1: System.Collections.Generic.IList c1list - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList) (Syntax: '(IList)c1arr') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList) (Syntax: '(IList)c1arr') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1arr (OperationKind.LocalReferenceExpression, Type: C1[]) (Syntax: 'c1arr') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -3948,11 +4067,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'IList / ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'IList / ... **/;') Variables: Local_1: System.Collections.Generic.IList c1list - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList, IsInvalid) (Syntax: '(IList)c1arr') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList, IsInvalid) (Syntax: '(IList)c1arr') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1arr (OperationKind.LocalReferenceExpression, Type: C1[][], IsInvalid) (Syntax: 'c1arr') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -3980,11 +4100,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C1[] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C1[] /**/;') Variables: Local_1: C1[] c1arr - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: C1[]) (Syntax: '(C1[])c1List') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1[]) (Syntax: '(C1[])c1List') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1List (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.IList) (Syntax: 'c1List') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4008,11 +4129,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'C1[][] /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'C1[][] /**/;') Variables: Local_1: C1[][] c1arr - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: C1[][], IsInvalid) (Syntax: '(C1[][])c1List') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C1[][], IsInvalid) (Syntax: '(C1[][])c1List') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1List (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.IList, IsInvalid) (Syntax: 'c1List') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -4039,11 +4161,12 @@ static void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Action /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Action /**/;') Variables: Local_1: System.Action a - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: '(Action)d') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: '(Action)d') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: d (OperationKind.LocalReferenceExpression, Type: System.Delegate) (Syntax: 'd') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4080,11 +4203,12 @@ class C4 : C3 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /**/;') Variables: Local_1: I1 c1 - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: '(I1)c2') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: '(I1)c2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c2 (OperationKind.LocalReferenceExpression, Type: C2) (Syntax: 'c2') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4105,11 +4229,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)o') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)o') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: o (OperationKind.LocalReferenceExpression, Type: System.Object) (Syntax: 'o') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4130,11 +4255,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)d') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)d') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: d (OperationKind.LocalReferenceExpression, Type: dynamic) (Syntax: 'd') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4157,11 +4283,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int /**/;') Variables: Local_1: System.Int32 i - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)v') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32) (Syntax: '(int)v') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: v (OperationKind.LocalReferenceExpression, Type: System.ValueType) (Syntax: 'v') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4189,11 +4316,12 @@ enum E1 One = 1 } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'E1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'E1 /* ... **/;') Variables: Local_1: E1 e1 - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: E1) (Syntax: '(E1)e') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: E1) (Syntax: '(E1)e') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: e (OperationKind.LocalReferenceExpression, Type: System.Enum) (Syntax: 'e') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4221,11 +4349,12 @@ enum E1 One = 1 } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'E1? /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'E1? /**/;') Variables: Local_1: E1? e1 - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: E1?) (Syntax: '(E1?)e') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: E1?) (Syntax: '(E1?)e') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: e (OperationKind.LocalReferenceExpression, Type: System.Enum) (Syntax: 'e') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4253,12 +4382,14 @@ enum E1 One = 1 } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int? /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'int? /**/;') Variables: Local_1: System.Int32? e1 - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32?, IsInvalid) (Syntax: '(E1?)e') - Operand: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: E1?, IsInvalid) (Syntax: '(E1?)e') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32?, IsInvalid) (Syntax: '(E1?)e') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: E1?, IsInvalid) (Syntax: '(E1?)e') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: e (OperationKind.LocalReferenceExpression, Type: System.Enum, IsInvalid) (Syntax: 'e') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -4289,11 +4420,12 @@ interface I1 { } struct S1 : I1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'S1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'S1 /* ... **/;') Variables: Local_1: S1 s1 - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: S1) (Syntax: '(S1)i') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: S1) (Syntax: '(S1)i') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: I1) (Syntax: 'i') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4320,11 +4452,12 @@ interface I1 { } struct S1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'S1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'S1 /* ... **/;') Variables: Local_1: S1 s1 - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: S1, IsInvalid) (Syntax: '(S1)i') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: S1, IsInvalid) (Syntax: '(S1)i') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: I1, IsInvalid) (Syntax: 'i') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -4356,11 +4489,12 @@ interface I1 { } struct S1 : I1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'IList / ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'IList / ... **/;') Variables: Local_1: System.Collections.Generic.IList s1List - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList) (Syntax: '(IList)i1List') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IList) (Syntax: '(IList)i1List') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i1List (OperationKind.LocalReferenceExpression, Type: System.Collections.Generic.IList) (Syntax: 'i1List') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4382,11 +4516,12 @@ class C1 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'T /** ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'T /** ... **/;') Variables: Local_1: T t - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: T) (Syntax: '(T)u') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: T) (Syntax: '(T)u') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: u (OperationKind.ParameterReferenceExpression, Type: U) (Syntax: 'u') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4408,11 +4543,12 @@ class C1 } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'T /** ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'T /** ... **/;') Variables: Local_1: T t - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: T, IsInvalid) (Syntax: '(T)u') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: T, IsInvalid) (Syntax: '(T)u') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: u (OperationKind.ParameterReferenceExpression, Type: U, IsInvalid) (Syntax: 'u') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -4438,11 +4574,12 @@ void M1(I1 i) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'T /** ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'T /** ... **/;') Variables: Local_1: T t - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: T) (Syntax: '(T)i') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: T) (Syntax: '(T)i') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: i (OperationKind.ParameterReferenceExpression, Type: I1) (Syntax: 'i') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4464,11 +4601,12 @@ void M1(T t) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i - Initializer: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: '(I1)t') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: '(I1)t') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: t (OperationKind.ParameterReferenceExpression, Type: T) (Syntax: 't') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4493,11 +4631,12 @@ void M1() class C2 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C2 /* ... **/;') Variables: Local_1: C2 c2 - Initializer: IConversionExpression (ConversionKind.OperatorMethod, Explicit) (OperatorMethod: C2 C1.op_Implicit(C1 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(C2)c1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(C2)c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: C1) (Syntax: 'c1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4522,11 +4661,12 @@ void M1() class C2 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C2 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C2 /* ... **/;') Variables: Local_1: C2 c2 - Initializer: IConversionExpression (ConversionKind.OperatorMethod, Explicit) (OperatorMethod: C2 C1.op_Explicit(C1 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(C2)c1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(C2)c1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: C1) (Syntax: 'c1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4553,12 +4693,14 @@ void M1() class C2 : I1 { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'I1 /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'I1 /* ... **/;') Variables: Local_1: I1 i1 - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: I1) (Syntax: '(C2)c1') - Operand: IConversionExpression (ConversionKind.OperatorMethod, Explicit) (OperatorMethod: C2 C1.op_Explicit(C1 c1)) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(C2)c1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: I1) (Syntax: '(C2)c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: C2) (Syntax: '(C2)c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: c1 (OperationKind.LocalReferenceExpression, Type: C1) (Syntax: 'c1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4580,11 +4722,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Action /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Action /**/;') Variables: Local_1: System.Action a - Initializer: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: '(Action)(() => { })') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: '(Action)(() => { })') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '() => { }') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ }') IReturnStatement (OperationKind.ReturnStatement) (Syntax: '{ }') @@ -4609,11 +4752,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Action /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Action /**/;') Variables: Local_1: System.Action a - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)(() => 1)') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)(() => 1)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '() => 1') IBlockStatement (2 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '1') IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: '1') @@ -4644,11 +4788,12 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Action /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Action /**/;') Variables: Local_1: System.Action a - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)((s ... s) => { })') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)((s ... s) => { })') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '(string s) => { }') IBlockStatement (0 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '{ }') "; @@ -4675,10 +4820,11 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'new Action( ... () => { }))') Children(1): - IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: '(Action)(() => { })') + IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: '(Action)(() => { })') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '() => { }') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ }') IReturnStatement (OperationKind.ReturnStatement) (Syntax: '{ }') @@ -4703,10 +4849,11 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvalidExpression (OperationKind.InvalidExpression, Type: System.Action, IsInvalid) (Syntax: 'new Action( ... )(() => 1))') Children(1): - IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)(() => 1)') + IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)(() => 1)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '() => 1') IBlockStatement (2 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '1') IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: '1') @@ -4737,10 +4884,11 @@ void M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvalidExpression (OperationKind.InvalidExpression, Type: System.Action, IsInvalid) (Syntax: 'new Action( ... s) => { }))') Children(1): - IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)((s ... s) => { })') + IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)((s ... s) => { })') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '(string s) => { }') IBlockStatement (0 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: '{ }') "; @@ -4769,12 +4917,13 @@ void M1() void M2() { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Action /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Action /**/;') Variables: Local_1: System.Action a Initializer: IMethodBindingExpression: void C1.M2() (OperationKind.MethodBindingExpression, Type: System.Action) (Syntax: '(Action)M2') - Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: C1) (Syntax: 'M2')"; + Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: C1) (Syntax: 'M2') +"; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); @@ -4796,11 +4945,12 @@ void M1() void M2(int i) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Action /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Action /**/;') Variables: Local_1: System.Action a - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)M2') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)M2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'M2') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -4893,10 +5043,11 @@ void M1() void M2(int i) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvalidExpression (OperationKind.InvalidExpression, Type: System.Action, IsInvalid) (Syntax: 'new Action((Action)M2)') Children(1): - IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)M2') + IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)M2') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'M2') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -4924,7 +5075,7 @@ void M1() int M2() { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvalidExpression (OperationKind.InvalidExpression, Type: System.Action, IsInvalid) (Syntax: 'new Action((Action)M2)') Children(1): IMethodBindingExpression: System.Int32 C1.M2() (OperationKind.MethodBindingExpression, Type: System.Action, IsInvalid) (Syntax: '(Action)M2') @@ -4956,9 +5107,10 @@ int M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'return (int)1.0;') - ReturnedValue: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: '(int)1.0') + ReturnedValue: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: '(int)1.0') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 1) (Syntax: '1.0') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -4980,10 +5132,12 @@ int M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'return (int)"""";') - ReturnedValue: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '(int)""""') - Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: """", IsInvalid) (Syntax: '""""')"; + ReturnedValue: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '(int)""""') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: """", IsInvalid) (Syntax: '""""') +"; var expectedDiagnostics = new DiagnosticDescription[] { // CS0030: Cannot convert type 'string' to 'int' // /**/return (int)"";/**/ @@ -5007,9 +5161,10 @@ int M1() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'return (int);') - ReturnedValue: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '(int)') + ReturnedValue: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '(int)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) "; diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs index 089f97aa2b88e170dd593dff7ffed9c129c87028..a15e8ec71e0c75f05fbbb9fce781b1e18519ff9f 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs @@ -26,7 +26,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (true) ... }') Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') @@ -65,7 +65,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (true) ... }') Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') @@ -108,7 +108,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (1 == 1) ... }') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean, Constant: True) (Syntax: '1 == 1') Left: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') @@ -154,7 +154,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (m > 10) ... }') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 10') Left: ILocalReferenceExpression: m (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'm') @@ -211,7 +211,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (m > 10) ... }') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 10') Left: ILocalReferenceExpression: m (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'm') @@ -264,7 +264,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (m >= n ... }') Condition: IBinaryOperatorExpression (BinaryOperationKind.BooleanConditionalAnd) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm >= n && m >= p') Left: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThanOrEqual) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm >= n') @@ -316,7 +316,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (n > 20) ... }') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'n > 20') Left: ILocalReferenceExpression: n (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'n') @@ -374,7 +374,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (int.Try ... , s ={s}"");') Condition: IInvocationExpression (System.Boolean System.Int32.TryParse(System.String s, out System.Int32 result)) (OperationKind.InvocationExpression, Type: System.Boolean) (Syntax: 'int.TryPars ... out var i)') Instance Receiver: null @@ -461,7 +461,7 @@ private int A() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (true) ... eLine(A());') Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Cons ... eLine(A());') @@ -504,7 +504,7 @@ private void A(bool flag) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (true) ... }') Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IBlockStatement (1 statements, 1 locals) (OperationKind.BlockStatement) (Syntax: '{ ... }') @@ -556,7 +556,7 @@ private static void A(bool flag, int number) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (true) ... int i, 1);') Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IBlockStatement (1 statements, 1 locals) (OperationKind.BlockStatement) (Syntax: 'A(o is int i, 1);') @@ -601,7 +601,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (obj is ... }') Condition: IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean) (Syntax: 'obj is string str') Expression: ILocalReferenceExpression: obj (OperationKind.LocalReferenceExpression, Type: System.Object) (Syntax: 'obj') @@ -642,7 +642,7 @@ private static void A(object o) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (true) ... A(25);') Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'A(25);') @@ -650,7 +650,8 @@ private static void A(object o) Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: o) (OperationKind.Argument) (Syntax: '25') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '25') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '25') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 25) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 25) (Syntax: '25') InConversion: null OutConversion: null @@ -685,7 +686,7 @@ private static void A(bool flag, int number) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (true) ... }') Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IBlockStatement (1 statements, 1 locals) (OperationKind.BlockStatement) (Syntax: '{ ... }') @@ -731,7 +732,7 @@ private void M() /**/ } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement, IsInvalid) (Syntax: 'if (obj is ... else') Condition: IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean) (Syntax: 'obj is string str') Expression: ILocalReferenceExpression: obj (OperationKind.LocalReferenceExpression, Type: System.Object) (Syntax: 'obj') @@ -783,9 +784,10 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement, IsInvalid) (Syntax: 'if () ... }') - Condition: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: '') + Condition: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') @@ -829,7 +831,7 @@ private void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement, IsInvalid) (Syntax: 'if (a == 1) ... else') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'a == 1') Left: ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'a') @@ -884,7 +886,7 @@ private void B() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (true) ... B();') Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'A();') @@ -924,7 +926,7 @@ class C } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (d.GetTy ... }') Condition: IUnaryOperatorExpression (UnaryOperationKind.DynamicTrue) (OperationKind.UnaryOperatorExpression, Type: System.Boolean) (Syntax: 'd.GetType() ... ).Equals(x)') Operand: IBinaryOperatorExpression (BinaryOperationKind.DynamicAnd) (OperationKind.BinaryOperatorExpression, Type: dynamic) (Syntax: 'd.GetType() ... ).Equals(x)') @@ -936,11 +938,13 @@ class C IParameterReferenceExpression: d (OperationKind.ParameterReferenceExpression, Type: dynamic) (Syntax: 'd') Right: IParameterReferenceExpression: t (OperationKind.ParameterReferenceExpression, Type: System.Type) (Syntax: 't') Right: IInvocationExpression (virtual System.Boolean System.ValueType.Equals(System.Object obj)) (OperationKind.InvocationExpression, Type: System.Boolean) (Syntax: '((T)d).Equals(x)') - Instance Receiver: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: T) (Syntax: '(T)d') + Instance Receiver: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: T) (Syntax: '(T)d') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: d (OperationKind.ParameterReferenceExpression, Type: dynamic) (Syntax: 'd') Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: obj) (OperationKind.Argument) (Syntax: 'x') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'x') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'x') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: T) (Syntax: 'x') InConversion: null OutConversion: null diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIsPatternExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIsPatternExpression.cs index b59c495f5a153477e9290ad9e2e90dcf16f1d269..52e90712a4f53429cc1c589641438ab97b262d0e 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIsPatternExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIsPatternExpression.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Test.Utilities; @@ -123,7 +123,7 @@ void M(X x) "; var expectedDiagnostics = new DiagnosticDescription[] { // CS8208: It is not legal to use the type 'dynamic' in a pattern. - // if (/**/x is dynamic y/**/) Console.WriteLine(y); + // if (/**/x is dynamic y/**/) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_PatternDynamicType, "dynamic").WithLocation(7, 28) }; @@ -169,11 +169,12 @@ void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean) (Syntax: 'x is (int)12.0') Expression: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.Int32?) (Syntax: 'x') Pattern: IConstantPattern (OperationKind.ConstantPattern) (Syntax: '(int)12.0') - Value: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 12) (Syntax: '(int)12.0') + Value: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 12) (Syntax: '(int)12.0') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 12) (Syntax: '12.0') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -195,16 +196,17 @@ void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x is 12.0') Expression: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.Int32?) (Syntax: 'x') Pattern: IConstantPattern (OperationKind.ConstantPattern, IsInvalid) (Syntax: '12.0') - Value: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 12, IsInvalid) (Syntax: '12.0') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 12, IsInvalid) (Syntax: '12.0') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 12, IsInvalid) (Syntax: '12.0') "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0266: Cannot implicitly convert type 'double' to 'int?'. An explicit conversion exists (are you missing a cast?) - // if (/**/x is 12.0/**/) Console.WriteLine(y); + // if (/**/x is 12.0/**/) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_NoImplicitConvCast, "12.0").WithArguments("double", "int?").WithLocation(8, 28) }; @@ -225,16 +227,17 @@ void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x is null') Expression: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'x') Pattern: IConstantPattern (OperationKind.ConstantPattern, IsInvalid) (Syntax: 'null') - Value: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'null') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'null') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null, IsInvalid) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0037: Cannot convert null to 'int' because it is a non-nullable value type - // if (/**/x is null/**/) Console.WriteLine(y); + // if (/**/x is null/**/) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_ValueCantBeNull, "null").WithArguments("int").WithLocation(8, 28) }; @@ -262,7 +265,7 @@ void M() "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0246: The type or namespace name 'UndefinedType' could not be found (are you missing a using directive or an assembly reference?) - // if (/**/x is UndefinedType y/**/) Console.WriteLine(y); + // if (/**/x is UndefinedType y/**/) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "UndefinedType").WithArguments("UndefinedType").WithLocation(8, 28) }; @@ -291,7 +294,7 @@ void M() "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0150: A constant value is expected - // if (/**/x is y/**/) Console.WriteLine(y); + // if (/**/x is y/**/) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_ConstantExpected, "y").WithLocation(8, 28) }; @@ -319,7 +322,7 @@ void M() "; var expectedDiagnostics = new DiagnosticDescription[] { // CS8121: An expression of type 'int?' cannot be handled by a pattern of type 'X'. - // if (/**/x is X y/**/) Console.WriteLine(y); + // if (/**/x is X y/**/) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_PatternWrongType, "X").WithArguments("int?", "X").WithLocation(8, 28) }; @@ -347,7 +350,7 @@ void M() "; var expectedDiagnostics = new DiagnosticDescription[] { // CS0128: A local variable or function named 'y' is already defined in this scope - // if (/**/x is int y/**/) Console.WriteLine(y); + // if (/**/x is int y/**/) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_LocalDuplicate, "y").WithArguments("y").WithLocation(8, 32) }; @@ -375,25 +378,25 @@ void M() "; var expectedDiagnostics = new DiagnosticDescription[] { // CS1026: ) expected - // if (/**/x is int y2/**/, y3) Console.WriteLine(y); + // if (/**/x is int y2/**/, y3) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_CloseParenExpected, ",").WithLocation(8, 45), // CS1525: Invalid expression term ',' - // if (/**/x is int y2/**/, y3) Console.WriteLine(y); + // if (/**/x is int y2/**/, y3) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_InvalidExprTerm, ",").WithArguments(",").WithLocation(8, 45), // CS1002: ; expected - // if (/**/x is int y2/**/, y3) Console.WriteLine(y); + // if (/**/x is int y2/**/, y3) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_SemicolonExpected, ",").WithLocation(8, 45), // CS1513: } expected - // if (/**/x is int y2/**/, y3) Console.WriteLine(y); + // if (/**/x is int y2/**/, y3) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_RbraceExpected, ",").WithLocation(8, 45), // CS1002: ; expected - // if (/**/x is int y2/**/, y3) Console.WriteLine(y); + // if (/**/x is int y2/**/, y3) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_SemicolonExpected, ")").WithLocation(8, 49), // CS1513: } expected - // if (/**/x is int y2/**/, y3) Console.WriteLine(y); + // if (/**/x is int y2/**/, y3) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_RbraceExpected, ")").WithLocation(8, 49), // CS0103: The name 'y3' does not exist in the current context - // if (/**/x is int y2/**/, y3) Console.WriteLine(y); + // if (/**/x is int y2/**/, y3) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_NameNotInContext, "y3").WithArguments("y3").WithLocation(8, 47) }; @@ -414,38 +417,39 @@ void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x is /**/') Expression: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'x') Pattern: IConstantPattern (OperationKind.ConstantPattern, IsInvalid) (Syntax: '') - Value: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) "; var expectedDiagnostics = new DiagnosticDescription[] { // CS1525: Invalid expression term 'const' - // if (/**/x is /**/const int y) Console.WriteLine(y); + // if (/**/x is /**/const int y) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_InvalidExprTerm, "const").WithArguments("const").WithLocation(8, 39), // CS1026: ) expected - // if (/**/x is /**/const int y) Console.WriteLine(y); + // if (/**/x is /**/const int y) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_CloseParenExpected, "const").WithLocation(8, 39), // CS1023: Embedded statement cannot be a declaration or labeled statement - // if (/**/x is /**/const int y) Console.WriteLine(y); + // if (/**/x is /**/const int y) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_BadEmbeddedStmt, "const int y").WithLocation(8, 39), // CS0145: A const field requires a value to be provided - // if (/**/x is /**/const int y) Console.WriteLine(y); + // if (/**/x is /**/const int y) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_ConstValueRequired, "y").WithLocation(8, 49), // CS1002: ; expected - // if (/**/x is /**/const int y) Console.WriteLine(y); + // if (/**/x is /**/const int y) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_SemicolonExpected, ")").WithLocation(8, 50), // CS1513: } expected - // if (/**/x is /**/const int y) Console.WriteLine(y); + // if (/**/x is /**/const int y) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_RbraceExpected, ")").WithLocation(8, 50), // CS0103: The name 'y' does not exist in the current context - // if (/**/x is /**/const int y) Console.WriteLine(y); + // if (/**/x is /**/const int y) Console.WriteLine(y); Diagnostic(ErrorCode.ERR_NameNotInContext, "y").WithArguments("y").WithLocation(8, 70), // CS0168: The variable 'y' is declared but never used - // if (/**/x is /**/const int y) Console.WriteLine(y); + // if (/**/x is /**/const int y) Console.WriteLine(y); Diagnostic(ErrorCode.WRN_UnreferencedVar, "y").WithArguments("y").WithLocation(8, 49) }; @@ -464,7 +468,7 @@ void M(string x = /**/string.Empty is string y/**/) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean, IsInvalid) (Syntax: 'string.Empty is string y') Expression: IFieldReferenceExpression: System.String System.String.Empty (Static) (OperationKind.FieldReferenceExpression, Type: System.String, IsInvalid) (Syntax: 'string.Empty') Instance Receiver: null @@ -489,7 +493,7 @@ class C private readonly bool b = /**/o is int x/**/ && x >= 5; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean, IsInvalid) (Syntax: 'o is int x') Expression: IFieldReferenceExpression: System.Object C.o (Static) (OperationKind.FieldReferenceExpression, Type: System.Object) (Syntax: 'o') Instance Receiver: null @@ -551,7 +555,7 @@ class C private const object o = 1; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean, IsInvalid) (Syntax: 'o is int x') Expression: IFieldReferenceExpression: System.Object C.o (Static) (OperationKind.FieldReferenceExpression, Type: System.Object, Constant: 1, IsInvalid) (Syntax: 'o') Instance Receiver: null @@ -569,4 +573,4 @@ class C VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } } -} \ No newline at end of file +} diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ILambdaExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ILambdaExpression.cs index 4ebe4ddfd27fd82ec8a141e028421a4b5c1af84d..61a8e72670bd397a2c9d1133d8a3c47a063c1345 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ILambdaExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ILambdaExpression.cs @@ -28,11 +28,12 @@ static void F() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Action x /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'Action x /* ... **/;') Variables: Local_1: System.Action x - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: '() => F()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action) (Syntax: '() => F()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '() => F()') IBlockStatement (2 statements) (OperationKind.BlockStatement) (Syntax: 'F()') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'F()') @@ -65,7 +66,7 @@ static void F() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'var x /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'var x /**/;') Variables: Local_1: var x @@ -103,11 +104,12 @@ static void F() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Action ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Action ... **/;') Variables: Local_1: System.Action x - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '() => F()') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: '() => F()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '() => F()') IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'F()') IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'F()') @@ -127,7 +129,7 @@ static void F() [Fact] public void ILambdaExpression_UnboundLambda_ReferenceEquality() { - string source = @" + string source = @" using System; class Program diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IObjectCreationExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IObjectCreationExpression.cs index db84542eac2ef66a0f8fc6ed6145250580a85dd3..481d96d36bd9543e241927c453a4725356660048 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IObjectCreationExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IObjectCreationExpression.cs @@ -40,7 +40,7 @@ public void M1() }/**/ } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IBlockStatement (7 statements, 7 locals) (OperationKind.BlockStatement, IsInvalid) (Syntax: '{ ... }') Locals: Local_1: F x1 Local_2: F x2 @@ -120,7 +120,8 @@ public void M1() ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: B, IsInvalid) (Syntax: 'Property2 = 1') Left: IPropertyReferenceExpression: B F.Property2 { get; set; } (OperationKind.PropertyReferenceExpression, Type: B) (Syntax: 'Property2') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: F) (Syntax: 'Property2') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: B, IsInvalid) (Syntax: '1') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: B, IsInvalid) (Syntax: '1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: '1') IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'var e2 = new F() { """" };') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'var e2 = new F() { """" };') @@ -161,7 +162,7 @@ public void M1(int x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IObjectCreationExpression (Constructor: System.Collections.Generic.List..ctor()) (OperationKind.ObjectCreationExpression, Type: System.Collections.Generic.List) (Syntax: 'new List) (Syntax: '{ x, y, field }') @@ -206,7 +207,7 @@ public void M1(int x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IObjectCreationExpression (Constructor: System.Collections.Generic.List>..ctor()) (OperationKind.ObjectCreationExpression, Type: System.Collections.Generic.List>) (Syntax: 'new List
  • >) (Syntax: '{ ... }') @@ -217,7 +218,8 @@ public void M1(int x) Instance Receiver: null Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'new[] { x, y }') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'new[] { x, y }') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'new[] { x, y }') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new[] { x, y }') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'new[] { x, y }') @@ -270,7 +272,7 @@ public void M(int x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IObjectCreationExpression (Constructor: Class..ctor()) (OperationKind.ObjectCreationExpression, Type: Class) (Syntax: 'new Class() ... }') Arguments(0) Initializer: IObjectOrCollectionInitializerExpression (OperationKind.ObjectOrCollectionInitializerExpression, Type: Class) (Syntax: '{ ... }') diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs index eb71b72a47a1ddebca780500765e517cd6b97b6a..7aec1aedb49a2ffeb9357c98556c9e7acbf476bf 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -69,14 +69,15 @@ public void M(Point point) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'var (x, y) = point') Children(2): ITupleExpression (OperationKind.TupleExpression, Type: (System.Int32 x, System.Int32 y)) (Syntax: 'var (x, y)') Elements(2): ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'x') ILocalReferenceExpression: y (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'y') - IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: (System.Int32 x, System.Int32 y)) (Syntax: 'point') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int32 x, System.Int32 y)) (Syntax: 'point') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: point (OperationKind.ParameterReferenceExpression, Type: Point) (Syntax: 'point') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -112,13 +113,13 @@ public void M(int x, string y) "; var expectedDiagnostics = DiagnosticDescription.None; -VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_QueryExpression() -{ - string source = @" + public void ParameterReference_QueryExpression() + { + string source = @" using System.Linq; using System.Collections.Generic; @@ -137,7 +138,7 @@ public void M(List customers) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'from cust i ... t cust.Name') Children(1): IOperation: (OperationKind.None) (Syntax: 'select cust.Name') @@ -146,14 +147,16 @@ public void M(List customers) Instance Receiver: null Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: source) (OperationKind.Argument) (Syntax: 'from cust in customers') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from cust in customers') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'from cust in customers') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 'from cust in customers') Children(1): IParameterReferenceExpression: customers (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.List) (Syntax: 'customers') InConversion: null OutConversion: null IArgument (ArgumentKind.Explicit, Matching Parameter: selector) (OperationKind.Argument) (Syntax: 'cust.Name') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'cust.Name') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func) (Syntax: 'cust.Name') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: 'cust.Name') IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'cust.Name') IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'cust.Name') @@ -162,15 +165,15 @@ public void M(List customers) InConversion: null OutConversion: null "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_ObjectAndCollectionInitializer() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_ObjectAndCollectionInitializer() + { + string source = @" using System.Collections.Generic; internal class Class @@ -186,7 +189,7 @@ public void M(int x, int y, int z) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IObjectCreationExpression (Constructor: Class..ctor()) (OperationKind.ObjectCreationExpression, Type: Class) (Syntax: 'new Class() ... { X = z } }') Arguments(0) Initializer: IObjectOrCollectionInitializerExpression (OperationKind.ObjectOrCollectionInitializerExpression, Type: Class) (Syntax: '{ X = x, Y ... { X = z } }') @@ -228,15 +231,15 @@ public void M(int x, int y, int z) Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: Class) (Syntax: 'X') Right: IParameterReferenceExpression: z (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'z') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DelegateCreationExpressionWithLambdaArgument() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DelegateCreationExpressionWithLambdaArgument() + { + string source = @" using System; class Class @@ -251,7 +254,7 @@ public void UsedParameterMethod1(Action a) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'new Action( ... })') Children(1): ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null) (Syntax: '() => ... }') @@ -263,15 +266,15 @@ public void UsedParameterMethod1(Action a) IReturnStatement (OperationKind.ReturnStatement) (Syntax: '{ ... }') ReturnedValue: null "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DelegateCreationExpressionWithMethodArgument() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DelegateCreationExpressionWithMethodArgument() + { + string source = @" using System; class Class @@ -288,20 +291,20 @@ public void Method2(int x, int y) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'new Delegate(Method2)') Children(1): IOperation: (OperationKind.None) (Syntax: 'Method2') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DelegateCreationExpressionWithInvalidArgument() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DelegateCreationExpressionWithInvalidArgument() + { + string source = @" using System; class Class @@ -314,24 +317,24 @@ public void Method(int x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvalidExpression (OperationKind.InvalidExpression, Type: Class.Delegate, IsInvalid) (Syntax: 'new Delegate(x)') Children(1): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'x') "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // CS0149: Method name expected // var a = /**/new Delegate(x)/**/; Diagnostic(ErrorCode.ERR_MethodNameExpected, "x").WithLocation(10, 40) }; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DynamicCollectionInitializer() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DynamicCollectionInitializer() + { + string source = @" using System.Collections.Generic; internal class Class @@ -344,7 +347,7 @@ public void M(int x, int y) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IObjectOrCollectionInitializerExpression (OperationKind.ObjectOrCollectionInitializerExpression, Type: Class) (Syntax: '{ X = { { x, y } } }') Initializers(1): IMemberInitializerExpression (OperationKind.MemberInitializerExpression, Type: dynamic) (Syntax: 'X = { { x, y } }') @@ -357,15 +360,15 @@ public void M(int x, int y) IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_NameOfExpression() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_NameOfExpression() + { + string source = @" class Class1 { public string M(int x) @@ -374,19 +377,19 @@ public string M(int x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" INameOfExpression (OperationKind.NameOfExpression, Type: System.String, Constant: ""x"") (Syntax: 'nameof(x)') IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_PointerIndirectionExpression() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_PointerIndirectionExpression() + { + string source = @" class Class1 { public unsafe int M(int *x) @@ -395,23 +398,23 @@ public unsafe int M(int *x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IPointerIndirectionReferenceExpression (OperationKind.PointerIndirectionReferenceExpression, Type: System.Int32) (Syntax: '*x') Pointer: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32*) (Syntax: 'x') "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // CS0227: Unsafe code may only appear if compiling with /unsafe // public unsafe int M(int *x) Diagnostic(ErrorCode.ERR_IllegalUnsafe, "M").WithLocation(4, 23) }; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_FixedLocalInitializer() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_FixedLocalInitializer() + { + string source = @" using System.Collections.Generic; internal class Class @@ -425,7 +428,7 @@ public unsafe void M(int[] array) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'p /**/= array') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'p /**/= array') Variables: Local_1: System.Int32* p @@ -433,19 +436,19 @@ public unsafe void M(int[] array) Children(1): IParameterReferenceExpression: array (OperationKind.ParameterReferenceExpression, Type: System.Int32[]) (Syntax: 'array') "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // CS0227: Unsafe code may only appear if compiling with /unsafe // public unsafe void M(int[] array) Diagnostic(ErrorCode.ERR_IllegalUnsafe, "M").WithLocation(6, 24) }; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_RefTypeOperator() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_RefTypeOperator() + { + string source = @" class Class1 { public System.Type M(System.TypedReference x) @@ -454,20 +457,20 @@ public System.Type M(System.TypedReference x) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: '__reftype(x)') Children(1): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.TypedReference) (Syntax: 'x') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_MakeRefOperator() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_MakeRefOperator() + { + string source = @" class Class1 { public void M(System.Type x) @@ -476,20 +479,20 @@ public void M(System.Type x) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: '__makeref(x)') Children(1): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Type) (Syntax: 'x') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_RefValueOperator() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_RefValueOperator() + { + string source = @" class Class1 { public void M(System.TypedReference x) @@ -498,20 +501,20 @@ public void M(System.TypedReference x) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: '__refvalue(x, int)') Children(1): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.TypedReference) (Syntax: 'x') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DynamicIndexerAccess() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DynamicIndexerAccess() + { + string source = @" class Class1 { public void M(dynamic d, int x) @@ -520,7 +523,7 @@ public void M(dynamic d, int x) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'var y /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'var y /**/;') Variables: Local_1: dynamic y @@ -529,15 +532,15 @@ public void M(dynamic d, int x) IParameterReferenceExpression: d (OperationKind.ParameterReferenceExpression, Type: dynamic) (Syntax: 'd') IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DynamicMemberAccess() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DynamicMemberAccess() + { + string source = @" class Class1 { public void M(dynamic x, int y) @@ -546,7 +549,7 @@ public void M(dynamic x, int y) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'x.M(y)') Children(2): IOperation: (OperationKind.None) (Syntax: 'x.M') @@ -554,15 +557,15 @@ public void M(dynamic x, int y) IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: dynamic) (Syntax: 'x') IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DynamicInvocation() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DynamicInvocation() + { + string source = @" class Class1 { public void M(dynamic x, int y) @@ -571,21 +574,21 @@ public void M(dynamic x, int y) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'x(y)') Children(2): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: dynamic) (Syntax: 'x') IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'y') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DynamicObjectCreation() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DynamicObjectCreation() + { + string source = @" internal class Class { public Class(Class x) { } @@ -597,7 +600,7 @@ public void M(dynamic x) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IDynamicObjectCreationExpression (Name: Class) (OperationKind.TypeParameterObjectCreationExpression, Type: Class) (Syntax: 'new Class(x)') ApplicableSymbols(2): Symbol: Class..ctor(Class x) @@ -608,15 +611,15 @@ public void M(dynamic x) ArgumentRefKinds(0) Initializer: null "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_StackAllocArrayCreation() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_StackAllocArrayCreation() + { + string source = @" using System.Collections.Generic; internal class Class @@ -627,24 +630,24 @@ public unsafe void M(int x) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'stackalloc int[x]') Children(1): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // CS0227: Unsafe code may only appear if compiling with /unsafe // public unsafe void M(int x) Diagnostic(ErrorCode.ERR_IllegalUnsafe, "M").WithLocation(6, 24) }; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_InterpolatedStringExpression() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_InterpolatedStringExpression() + { + string source = @" using System; internal class Class @@ -655,7 +658,7 @@ public void M(string x, int y) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IInterpolatedStringExpression (OperationKind.InterpolatedStringExpression, Type: System.String) (Syntax: '$""String {x ... nstant {1}""') Parts(6): IInterpolatedStringText (OperationKind.InterpolatedStringText) (Syntax: 'String ') @@ -677,15 +680,15 @@ public void M(string x, int y) Alignment: null FormatString: null "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_ThrowExpression() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_ThrowExpression() + { + string source = @" using System; internal class Class @@ -696,7 +699,7 @@ public void M(string x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IThrowExpression (OperationKind.ThrowExpression, Type: null) (Syntax: 'throw new A ... (nameof(x))') IObjectCreationExpression (Constructor: System.ArgumentNullException..ctor(System.String paramName)) (OperationKind.ObjectCreationExpression, Type: System.ArgumentNullException) (Syntax: 'new Argumen ... (nameof(x))') Arguments(1): @@ -707,15 +710,15 @@ public void M(string x) OutConversion: null Initializer: null "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_PatternSwitchStatement() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_PatternSwitchStatement() + { + string source = @" internal class Class { public void M(int x) @@ -728,7 +731,7 @@ public void M(int x) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') Sections: @@ -742,15 +745,15 @@ public void M(int x) Body: IBranchStatement (BranchKind.Break) (OperationKind.BranchStatement) (Syntax: 'break;') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_DefaultPatternSwitchStatement() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_DefaultPatternSwitchStatement() + { + string source = @" internal class Class { public void M(int x) @@ -766,7 +769,7 @@ public void M(int x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (2 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') Sections: @@ -785,15 +788,15 @@ public void M(int x) Body: IBranchStatement (BranchKind.Break) (OperationKind.BranchStatement) (Syntax: 'break;') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_UserDefinedLogicalConditionalOperator() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_UserDefinedLogicalConditionalOperator() + { + string source = @" class A { public static bool operator true(A o) { return true; } @@ -817,23 +820,25 @@ static void M(C x, C y) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'x && y') Children(2): - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: B) (Syntax: 'x') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: B) (Syntax: 'x') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: C) (Syntax: 'x') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: B) (Syntax: 'y') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: B) (Syntax: 'y') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: C) (Syntax: 'y') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_NoPiaObjectCreation() -{ - var sources0 = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_NoPiaObjectCreation() + { + var sources0 = @" using System; using System.Runtime.InteropServices; @@ -854,7 +859,7 @@ public C(object o) } } "; - var sources1 = @" + var sources1 = @" struct S { public I F(object x) @@ -863,29 +868,29 @@ public I F(object x) } } "; - var compilation0 = CreateStandardCompilation(sources0); - compilation0.VerifyDiagnostics(); + var compilation0 = CreateStandardCompilation(sources0); + compilation0.VerifyDiagnostics(); - var compilation1 = CreateStandardCompilation( - sources1, - references: new[] { MscorlibRef, SystemRef, compilation0.EmitToImageReference(embedInteropTypes: true) }); + var compilation1 = CreateStandardCompilation( + sources1, + references: new[] { MscorlibRef, SystemRef, compilation0.EmitToImageReference(embedInteropTypes: true) }); -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None, IsInvalid) (Syntax: 'new I(x)') "; - var expectedDiagnostics = new DiagnosticDescription[] { + var expectedDiagnostics = new DiagnosticDescription[] { // (6,25): error CS1729: 'I' does not contain a constructor that takes 1 arguments // return /**/new I(x)/**/; Diagnostic(ErrorCode.ERR_BadCtorArgCount, "(x)").WithArguments("I", "1").WithLocation(6, 25) }; - VerifyOperationTreeAndDiagnosticsForTest(compilation1, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(compilation1, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] -public void ParameterReference_ArgListOperator() -{ - string source = @" + [Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")] + public void ParameterReference_ArgListOperator() + { + string source = @" using System; class C { @@ -899,21 +904,21 @@ static void M(int x, __arglist) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: '__arglist(x, y)') Children(2): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Boolean) (Syntax: 'y') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(19790, "https://github.com/dotnet/roslyn/issues/19790")] -public void ParameterReference_IsPatternExpression() -{ - string source = @" + [Fact, WorkItem(19790, "https://github.com/dotnet/roslyn/issues/19790")] + public void ParameterReference_IsPatternExpression() + { + string source = @" class Class1 { public void Method1(object x) @@ -922,20 +927,20 @@ public void Method1(object x) } } "; - string expectedOperationTree = @" + string expectedOperationTree = @" IIsPatternExpression (OperationKind.IsPatternExpression, Type: System.Boolean) (Syntax: 'x is int y') Expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Pattern: IDeclarationPattern (Declared Symbol: System.Int32 y) (OperationKind.DeclarationPattern) (Syntax: 'int y') "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } -[Fact, WorkItem(19902, "https://github.com/dotnet/roslyn/issues/19902")] -public void ParameterReference_LocalFunctionStatement() -{ - string source = @" + [Fact, WorkItem(19902, "https://github.com/dotnet/roslyn/issues/19902")] + public void ParameterReference_LocalFunctionStatement() + { + string source = @" using System; using System.Collections.Generic; @@ -955,11 +960,12 @@ static IEnumerable MyIterator(IEnumerable source, Func predica } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ILocalFunctionStatement (Local Function: System.Collections.Generic.IEnumerable Iterator()) (OperationKind.LocalFunctionStatement) (Syntax: 'IEnumerable ... }') IBlockStatement (2 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IForEachLoopStatement (Iteration variable: T element) (LoopKind.ForEach) (OperationKind.LoopStatement) (Syntax: 'foreach (va ... rn element;') - Collection: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'source') + Collection: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'source') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: source (OperationKind.ParameterReferenceExpression, Type: System.Collections.Generic.IEnumerable) (Syntax: 'source') Body: IIfStatement (OperationKind.IfStatement) (Syntax: 'if (predica ... rn element;') Condition: IInvocationExpression (virtual System.Boolean System.Func.Invoke(T arg)) (OperationKind.InvocationExpression, Type: System.Boolean) (Syntax: 'predicate(element)') @@ -975,9 +981,9 @@ static IEnumerable MyIterator(IEnumerable source, Func predica IReturnStatement (OperationKind.YieldBreakStatement) (Syntax: '{ ... }') ReturnedValue: null "; - var expectedDiagnostics = DiagnosticDescription.None; + var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); -} + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } } } diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IPatternSwitchCase.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IPatternSwitchCase.cs index 391c5abad286924f965affc018c2f67093c87aeb..97fa558aaadfb5b92f614a9e53f43ac889375250 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IPatternSwitchCase.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IPatternSwitchCase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Test.Utilities; @@ -27,7 +27,7 @@ void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.Int32?) (Syntax: 'x') Sections: @@ -62,7 +62,7 @@ void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.Int32?) (Syntax: 'x') Sections: @@ -96,7 +96,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -130,7 +130,7 @@ class X } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -164,7 +164,7 @@ class X } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -204,7 +204,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (2 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -212,7 +212,8 @@ void M(object x) Clauses: IPatternCaseClause (Label Symbol: case null:) (CaseKind.Pattern) (OperationKind.PatternCaseClause) (Syntax: 'case null:') Pattern: IConstantPattern (OperationKind.ConstantPattern) (Syntax: 'case null:') - Value: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'null') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') Guard Expression: null Body: @@ -248,7 +249,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -256,7 +257,8 @@ void M(object x) Clauses: IPatternCaseClause (Label Symbol: case null:) (CaseKind.Pattern) (OperationKind.PatternCaseClause) (Syntax: 'case null:') Pattern: IConstantPattern (OperationKind.ConstantPattern) (Syntax: 'case null:') - Value: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'null') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') Guard Expression: null IPatternCaseClause (Label Symbol: case X y:) (CaseKind.Pattern) (OperationKind.PatternCaseClause) (Syntax: 'case X y:') @@ -289,7 +291,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -297,7 +299,8 @@ void M(object x) Clauses: IPatternCaseClause (Label Symbol: case null:) (CaseKind.Pattern) (OperationKind.PatternCaseClause) (Syntax: 'case null:') Pattern: IConstantPattern (OperationKind.ConstantPattern) (Syntax: 'case null:') - Value: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'null') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') Guard Expression: null IPatternCaseClause (Label Symbol: case X y:) (CaseKind.Pattern) (OperationKind.PatternCaseClause) (Syntax: 'case X y:') @@ -329,7 +332,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -339,7 +342,8 @@ void M(object x) Pattern: IDeclarationPattern (Declared Symbol: X y) (OperationKind.DeclarationPattern) (Syntax: 'X y') Guard Expression: IBinaryOperatorExpression (BinaryOperationKind.ObjectNotEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x != null') Left: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') - Right: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'null') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') Body: IBranchStatement (BranchKind.Break) (OperationKind.BranchStatement) (Syntax: 'break;') @@ -366,7 +370,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -402,7 +406,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -410,7 +414,8 @@ void M(object x) Clauses: IPatternCaseClause (Label Symbol: case X y when :) (CaseKind.Pattern) (OperationKind.PatternCaseClause, IsInvalid) (Syntax: 'case X y when :') Pattern: IDeclarationPattern (Declared Symbol: X y) (OperationKind.DeclarationPattern) (Syntax: 'X y') - Guard Expression: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: '') + Guard Expression: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) Body: @@ -442,7 +447,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -450,7 +455,8 @@ void M(object x) Clauses: IPatternCaseClause (Label Symbol: case X y when x:) (CaseKind.Pattern) (OperationKind.PatternCaseClause, IsInvalid) (Syntax: 'case X y when x:') Pattern: IDeclarationPattern (Declared Symbol: X y) (OperationKind.DeclarationPattern) (Syntax: 'X y') - Guard Expression: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x') + Guard Expression: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object, IsInvalid) (Syntax: 'x') Body: IBranchStatement (BranchKind.Break) (OperationKind.BranchStatement) (Syntax: 'break;') @@ -514,7 +520,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -549,7 +555,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x.G ... }') Switch expression: IInvocationExpression ( System.Type System.Object.GetType()) (OperationKind.InvocationExpression, Type: System.Type) (Syntax: 'x.GetType()') Instance Receiver: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') @@ -593,7 +599,7 @@ void M(object x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'x') Sections: @@ -631,7 +637,7 @@ void M(int? x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32?) (Syntax: 'x') Sections: @@ -670,7 +676,7 @@ void M(int? x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32?) (Syntax: 'x') Sections: @@ -711,14 +717,15 @@ void M(int? x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x) ... }') Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32?) (Syntax: 'x') Sections: ISwitchCase (1 case clauses, 2 statements) (OperationKind.SwitchCase, IsInvalid) (Syntax: 'case /**/') - Value: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) Body: @@ -773,7 +780,7 @@ void M(object p) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (3 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (p) ... }') Switch expression: IParameterReferenceExpression: p (OperationKind.ParameterReferenceExpression, Type: System.Object) (Syntax: 'p') Sections: diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.cs index 11aac3cad76a4ae25ed8633fc3929d72c485c27a..a6322b69cb9ea23d9348b8438477f42d8f01d6c3 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -44,7 +44,7 @@ class C static int s1 /**/= 1/**/; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Int32 C.s1) (OperationKind.FieldInitializer) (Syntax: '= 1') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; @@ -66,7 +66,7 @@ class C int i1 = 1, i2 /**/= 2/**/; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Int32 C.i2) (OperationKind.FieldInitializer) (Syntax: '= 2') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') "; @@ -131,9 +131,10 @@ class C void M(int p1 = 0, params int[] p2 /**/= null/**/) { } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IParameterInitializer (Parameter: params System.Int32[] p2) (OperationKind.ParameterInitializer) (Syntax: '= null') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Int32[], Constant: null) (Syntax: 'null') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32[], Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -156,7 +157,7 @@ class C static int F() { return 1; } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Int32 C.s1) (OperationKind.FieldInitializer) (Syntax: '= 1 + F()') IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '1 + F()') Left: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') @@ -182,7 +183,7 @@ class C static int F() { return 1; } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Int32 C.s1) (OperationKind.FieldInitializer) (Syntax: '= 1 + F()') IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '1 + F()') Left: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') @@ -206,7 +207,7 @@ class C static int F() { return 1; } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Int32 C.i1) (OperationKind.FieldInitializer) (Syntax: '= 1 + F()') IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: '1 + F()') Left: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') @@ -235,7 +236,7 @@ partial class C int i2 = 2; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Int32 C.s1) (OperationKind.FieldInitializer) (Syntax: '= 1') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; @@ -273,7 +274,7 @@ partial class C int i2 /**/= 2/**/; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Int32 C.i2) (OperationKind.FieldInitializer) (Syntax: '= 2') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') "; @@ -306,7 +307,7 @@ class C static System.Action MakeAction(int x) { return null; } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Action C.e) (OperationKind.FieldInitializer) (Syntax: '= MakeAction(1)') IInvocationExpression (System.Action C.MakeAction(System.Int32 x)) (OperationKind.InvocationExpression, Type: System.Action) (Syntax: 'MakeAction(1)') Instance Receiver: null @@ -332,7 +333,7 @@ class C static System.Action MakeAction(int x) { return null; } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Action C.f) (OperationKind.FieldInitializer) (Syntax: '= MakeAction(2)') IInvocationExpression (System.Action C.MakeAction(System.Int32 x)) (OperationKind.InvocationExpression, Type: System.Action) (Syntax: 'MakeAction(2)') Instance Receiver: null diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ITupleExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ITupleExpression.cs index 308c3c3baf4ace4b0da7fe9f60f3e5507954302a..b06b1ca841ae2180adb5059e4885c128566d6ebe 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ITupleExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ITupleExpression.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -80,12 +80,14 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ITupleExpression (OperationKind.TupleExpression, Type: (System.UInt32, System.UInt32)) (Syntax: '(1, 2)') Elements(2): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 2) (Syntax: '2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 2) (Syntax: '2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -108,16 +110,19 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: '(uint, uint ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: '(uint, uint ... **/;') Variables: Local_1: (System.UInt32, System.UInt32) t - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: (System.UInt32, System.UInt32)) (Syntax: '(1, 2)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.UInt32, System.UInt32)) (Syntax: '(1, 2)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITupleExpression (OperationKind.TupleExpression, Type: (System.UInt32, System.UInt32)) (Syntax: '(1, 2)') Elements(2): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 2) (Syntax: '2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 2) (Syntax: '2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -142,12 +147,14 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ITupleExpression (OperationKind.TupleExpression, Type: (System.Int64 a, System.Int64 b)) (Syntax: '(a, b)') Elements(2): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'a') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'a') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'a') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'b') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'b') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: b (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'b') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -172,16 +179,19 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: '(long, long ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: '(long, long ... **/;') Variables: Local_1: (System.Int64, System.Int64) t - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: (System.Int64, System.Int64)) (Syntax: '(a, b)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int64, System.Int64)) (Syntax: '(a, b)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITupleExpression (OperationKind.TupleExpression, Type: (System.Int64 a, System.Int64 b)) (Syntax: '(a, b)') Elements(2): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'a') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'a') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'a') - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'b') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: 'b') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: b (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'b') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -204,12 +214,14 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ITupleExpression (OperationKind.TupleExpression, Type: (System.UInt32, System.String)) (Syntax: '(1, null)') Elements(2): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -232,16 +244,19 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: '(uint, stri ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: '(uint, stri ... **/;') Variables: Local_1: (System.UInt32, System.String) t - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: (System.UInt32, System.String)) (Syntax: '(1, null)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.UInt32, System.String)) (Syntax: '(1, null)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITupleExpression (OperationKind.TupleExpression, Type: (System.UInt32, System.String)) (Syntax: '(1, null)') Elements(2): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.UInt32, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -345,11 +360,12 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: '(int A, int ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: '(int A, int ... **/;') Variables: Local_1: (System.Int32 A, System.Int32 B) t - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: (System.Int32 A, System.Int32 B)) (Syntax: '(1, 2)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int32 A, System.Int32 B)) (Syntax: '(1, 2)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITupleExpression (OperationKind.TupleExpression, Type: (System.Int32, System.Int32)) (Syntax: '(1, 2)') Elements(2): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') @@ -375,12 +391,14 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ITupleExpression (OperationKind.TupleExpression, Type: (System.Int16 A, System.String B)) (Syntax: '(A: 1, B: null)') Elements(2): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int16, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int16, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -410,16 +428,19 @@ static void Main() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: '(short, str ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: '(short, str ... **/;') Variables: Local_1: (System.Int16, System.String) t - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: (System.Int16, System.String)) (Syntax: '(A: 1, B: null)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int16, System.String)) (Syntax: '(A: 1, B: null)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITupleExpression (OperationKind.TupleExpression, Type: (System.Int16 A, System.String B)) (Syntax: '(A: 1, B: null)') Elements(2): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int16, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int16, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = new DiagnosticDescription[] { @@ -470,10 +491,11 @@ public void M(C c1) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ITupleExpression (OperationKind.TupleExpression, Type: (System.Int16, System.String c1)) (Syntax: '(new C(0), c1)') Elements(2): - IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: System.Int16 C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: System.Int16) (Syntax: 'new C(0)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: System.Int16 C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: System.Int16) (Syntax: 'new C(0)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: System.Int16 C.op_Implicit(C c)) Operand: IObjectCreationExpression (Constructor: C..ctor(System.Int32 x)) (OperationKind.ObjectCreationExpression, Type: C) (Syntax: 'new C(0)') Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '0') @@ -481,7 +503,8 @@ public void M(C c1) InConversion: null OutConversion: null Initializer: null - IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: System.String C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: System.String C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: System.String C.op_Implicit(C c)) Operand: IParameterReferenceExpression: c1 (OperationKind.ParameterReferenceExpression, Type: C) (Syntax: 'c1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -525,14 +548,16 @@ public void M(C c1) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: '(short, str ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: '(short, str ... **/;') Variables: Local_1: (System.Int16, System.String) t - Initializer: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: (System.Int16, System.String)) (Syntax: '(new C(0), c1)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int16, System.String)) (Syntax: '(new C(0), c1)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITupleExpression (OperationKind.TupleExpression, Type: (System.Int16, System.String c1)) (Syntax: '(new C(0), c1)') Elements(2): - IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: System.Int16 C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: System.Int16) (Syntax: 'new C(0)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: System.Int16 C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: System.Int16) (Syntax: 'new C(0)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: System.Int16 C.op_Implicit(C c)) Operand: IObjectCreationExpression (Constructor: C..ctor(System.Int32 x)) (OperationKind.ObjectCreationExpression, Type: C) (Syntax: 'new C(0)') Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '0') @@ -540,7 +565,8 @@ public void M(C c1) InConversion: null OutConversion: null Initializer: null - IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: System.String C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'c1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: System.String C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: System.String) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: System.String C.op_Implicit(C c)) Operand: IParameterReferenceExpression: c1 (OperationKind.ParameterReferenceExpression, Type: C) (Syntax: 'c1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -579,11 +605,12 @@ public void M(C c1) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ITupleExpression (OperationKind.TupleExpression, Type: (System.Int32, System.String)) (Syntax: '(0, null)') Elements(2): ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -622,16 +649,19 @@ public void M(C c1) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'C t = (0, n ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'C t = (0, n ... **/;') Variables: Local_1: C t - Initializer: IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: C C.op_Implicit((System.Int32, System.String) x)) (OperationKind.ConversionExpression, Type: C) (Syntax: '(0, null)') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: (System.Int32, System.String)) (Syntax: '(0, null)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: C C.op_Implicit((System.Int32, System.String) x)) (OperationKind.ConversionExpression, Type: C) (Syntax: '(0, null)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C C.op_Implicit((System.Int32, System.String) x)) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: C C.op_Implicit((System.Int32, System.String) x)) (OperationKind.ConversionExpression, Type: (System.Int32, System.String)) (Syntax: '(0, null)') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: C C.op_Implicit((System.Int32, System.String) x)) Operand: ITupleExpression (OperationKind.TupleExpression, Type: (System.Int32, System.String)) (Syntax: '(0, null)') Elements(2): ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -709,11 +739,12 @@ public void M(C c1) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: '(int, strin ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: '(int, strin ... **/;') Variables: Local_1: (System.Int32, System.String) t - Initializer: IConversionExpression (ConversionKind.OperatorMethod, Implicit) (OperatorMethod: (System.Int32, System.String) C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: (System.Int32, System.String)) (Syntax: 'c1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperatorMethod: (System.Int32, System.String) C.op_Implicit(C c)) (OperationKind.ConversionExpression, Type: (System.Int32, System.String)) (Syntax: 'c1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: True) (MethodSymbol: (System.Int32, System.String) C.op_Implicit(C c)) Operand: IParameterReferenceExpression: c1 (OperationKind.ParameterReferenceExpression, Type: C) (Syntax: 'c1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -814,11 +845,12 @@ public void M(C c1) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: '(short, str ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: '(short, str ... **/;') Variables: Local_1: (System.Int16, System.String) t - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: (System.Int16, System.String), IsInvalid) (Syntax: '(new C(0), c1)') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int16, System.String), IsInvalid) (Syntax: '(new C(0), c1)') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ITupleExpression (OperationKind.TupleExpression, Type: (C, C c1), IsInvalid) (Syntax: '(new C(0), c1)') Elements(2): IObjectCreationExpression (Constructor: C..ctor(System.Int32 x)) (OperationKind.ObjectCreationExpression, Type: C, IsInvalid) (Syntax: 'new C(0)') @@ -869,14 +901,15 @@ public void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'var (x, y) ... Point(0, 1)') Children(2): ITupleExpression (OperationKind.TupleExpression, Type: (System.Int32 x, System.Int32 y)) (Syntax: 'var (x, y)') Elements(2): ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'x') ILocalReferenceExpression: y (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'y') - IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: (System.Int32 x, System.Int32 y)) (Syntax: 'new Point(0, 1)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.Int32 x, System.Int32 y)) (Syntax: 'new Point(0, 1)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: Point..ctor(System.Int32 x, System.Int32 y)) (OperationKind.ObjectCreationExpression, Type: Point) (Syntax: 'new Point(0, 1)') Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '0') @@ -926,9 +959,10 @@ public void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IForEachLoopStatement (Iteration variable: null) (LoopKind.ForEach) (OperationKind.LoopStatement) (Syntax: 'foreach (va ... }') - Collection: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'new Point[] ... int(0, 1) }') + Collection: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.IEnumerable) (Syntax: 'new Point[] ... int(0, 1) }') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: IArrayCreationExpression (Element Type: Point) (OperationKind.ArrayCreationExpression, Type: Point[]) (Syntax: 'new Point[] ... int(0, 1) }') Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'new Point[] ... int(0, 1) }') @@ -982,14 +1016,15 @@ public void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: '(uint x, ui ... Point(0, 1)') Children(2): ITupleExpression (OperationKind.TupleExpression, Type: (System.UInt32 x, System.UInt32 y)) (Syntax: '(uint x, uint y)') Elements(2): ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: System.UInt32) (Syntax: 'uint x') ILocalReferenceExpression: y (OperationKind.LocalReferenceExpression, Type: System.UInt32) (Syntax: 'uint y') - IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: (System.UInt32 x, System.UInt32 y)) (Syntax: 'new Point(0, 1)') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: (System.UInt32 x, System.UInt32 y)) (Syntax: 'new Point(0, 1)') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IObjectCreationExpression (Constructor: Point..ctor(System.Int32 x, System.Int32 y)) (OperationKind.ObjectCreationExpression, Type: Point) (Syntax: 'new Point(0, 1)') Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '0') diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.cs index b6d045287b78624442ee9171cec59fbda34af038..3babc1c8e7f33cdbf19869ba11ee9966ac08fb81 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.cs @@ -22,9 +22,10 @@ System.SByte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.SByte, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -44,9 +45,10 @@ System.Byte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Byte, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -66,9 +68,10 @@ System.Int16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int16, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -88,9 +91,10 @@ System.UInt16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt16, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -110,7 +114,7 @@ System.Int32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i') "; @@ -131,7 +135,7 @@ System.UInt32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.UInt32) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt32) (Syntax: 'i') "; @@ -152,7 +156,7 @@ System.Int64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int64) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int64) (Syntax: 'i') "; @@ -173,7 +177,7 @@ System.UInt64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.UInt64) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt64) (Syntax: 'i') "; @@ -194,9 +198,10 @@ System.Char Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Char, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -216,7 +221,7 @@ System.Decimal Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DecimalPlus) (OperationKind.UnaryOperatorExpression, Type: System.Decimal) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Decimal) (Syntax: 'i') "; @@ -237,7 +242,7 @@ System.Single Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.FloatingPlus) (OperationKind.UnaryOperatorExpression, Type: System.Single) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Single) (Syntax: 'i') "; @@ -258,7 +263,7 @@ System.Double Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.FloatingPlus) (OperationKind.UnaryOperatorExpression, Type: System.Double) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Double) (Syntax: 'i') "; @@ -279,7 +284,7 @@ System.Boolean Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Boolean, IsInvalid) (Syntax: 'i') "; @@ -300,7 +305,7 @@ System.Object Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Object, IsInvalid) (Syntax: 'i') "; @@ -321,9 +326,10 @@ System.SByte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.SByte, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -343,9 +349,10 @@ System.Byte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Byte, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -365,9 +372,10 @@ System.Int16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int16, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -387,9 +395,10 @@ System.UInt16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt16, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -409,7 +418,7 @@ System.Int32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i') "; @@ -430,9 +439,10 @@ System.UInt32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int64, IsInvalid) (Syntax: '-i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt32, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -452,7 +462,7 @@ System.Int64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int64) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int64) (Syntax: 'i') "; @@ -473,7 +483,7 @@ System.UInt64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt64, IsInvalid) (Syntax: 'i') "; @@ -494,9 +504,10 @@ System.Char Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Char, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -516,7 +527,7 @@ System.Decimal Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DecimalMinus) (OperationKind.UnaryOperatorExpression, Type: System.Decimal) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Decimal) (Syntax: 'i') "; @@ -537,7 +548,7 @@ System.Single Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.FloatingMinus) (OperationKind.UnaryOperatorExpression, Type: System.Single) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Single) (Syntax: 'i') "; @@ -558,7 +569,7 @@ System.Double Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.FloatingMinus) (OperationKind.UnaryOperatorExpression, Type: System.Double) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Double) (Syntax: 'i') "; @@ -579,7 +590,7 @@ System.Boolean Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Boolean, IsInvalid) (Syntax: 'i') "; @@ -600,7 +611,7 @@ System.Object Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Object, IsInvalid) (Syntax: 'i') "; @@ -621,9 +632,10 @@ System.SByte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.SByte A.Method()) (OperationKind.InvocationExpression, Type: System.SByte, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -645,9 +657,10 @@ System.Byte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Byte A.Method()) (OperationKind.InvocationExpression, Type: System.Byte, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -669,9 +682,10 @@ System.Int16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Int16 A.Method()) (OperationKind.InvocationExpression, Type: System.Int16, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -693,9 +707,10 @@ System.UInt16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.UInt16 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt16, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -717,7 +732,7 @@ System.Int32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32) (Syntax: '+Method()') Operand: IInvocationExpression ( System.Int32 A.Method()) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -740,7 +755,7 @@ System.UInt32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.UInt32) (Syntax: '+Method()') Operand: IInvocationExpression ( System.UInt32 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt32) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -763,7 +778,7 @@ System.Int64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int64) (Syntax: '+Method()') Operand: IInvocationExpression ( System.Int64 A.Method()) (OperationKind.InvocationExpression, Type: System.Int64) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -786,7 +801,7 @@ System.UInt64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.UInt64) (Syntax: '+Method()') Operand: IInvocationExpression ( System.UInt64 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt64) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -809,9 +824,10 @@ System.Char Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerPlus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '+Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Char A.Method()) (OperationKind.InvocationExpression, Type: System.Char, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -833,7 +849,7 @@ System.Decimal Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DecimalPlus) (OperationKind.UnaryOperatorExpression, Type: System.Decimal) (Syntax: '+Method()') Operand: IInvocationExpression ( System.Decimal A.Method()) (OperationKind.InvocationExpression, Type: System.Decimal) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -856,7 +872,7 @@ System.Single Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.FloatingPlus) (OperationKind.UnaryOperatorExpression, Type: System.Single) (Syntax: '+Method()') Operand: IInvocationExpression ( System.Single A.Method()) (OperationKind.InvocationExpression, Type: System.Single) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -879,7 +895,7 @@ System.Double Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.FloatingPlus) (OperationKind.UnaryOperatorExpression, Type: System.Double) (Syntax: '+Method()') Operand: IInvocationExpression ( System.Double A.Method()) (OperationKind.InvocationExpression, Type: System.Double) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -902,7 +918,7 @@ System.Boolean Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+Method()') Operand: IInvocationExpression ( System.Boolean A.Method()) (OperationKind.InvocationExpression, Type: System.Boolean, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -925,7 +941,7 @@ System.Object Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+Method()') Operand: IInvocationExpression ( System.Object A.Method()) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -948,9 +964,10 @@ System.SByte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.SByte A.Method()) (OperationKind.InvocationExpression, Type: System.SByte, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -972,9 +989,10 @@ System.Byte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Byte A.Method()) (OperationKind.InvocationExpression, Type: System.Byte, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -996,9 +1014,10 @@ System.Int16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Int16 A.Method()) (OperationKind.InvocationExpression, Type: System.Int16, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1020,9 +1039,10 @@ System.UInt16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.UInt16 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt16, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1044,7 +1064,7 @@ System.Int32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32) (Syntax: '-Method()') Operand: IInvocationExpression ( System.Int32 A.Method()) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1067,9 +1087,10 @@ System.UInt32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int64, IsInvalid) (Syntax: '-Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.UInt32 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt32, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1091,7 +1112,7 @@ System.Int64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int64) (Syntax: '-Method()') Operand: IInvocationExpression ( System.Int64 A.Method()) (OperationKind.InvocationExpression, Type: System.Int64) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1114,7 +1135,7 @@ System.UInt64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '-Method()') Operand: IInvocationExpression ( System.UInt64 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt64, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -1137,9 +1158,10 @@ System.Char Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerMinus) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '-Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Char A.Method()) (OperationKind.InvocationExpression, Type: System.Char, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1161,7 +1183,7 @@ System.Decimal Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DecimalMinus) (OperationKind.UnaryOperatorExpression, Type: System.Decimal) (Syntax: '-Method()') Operand: IInvocationExpression ( System.Decimal A.Method()) (OperationKind.InvocationExpression, Type: System.Decimal) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1184,7 +1206,7 @@ System.Single Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.FloatingMinus) (OperationKind.UnaryOperatorExpression, Type: System.Single) (Syntax: '-Method()') Operand: IInvocationExpression ( System.Single A.Method()) (OperationKind.InvocationExpression, Type: System.Single) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1207,7 +1229,7 @@ System.Double Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.FloatingMinus) (OperationKind.UnaryOperatorExpression, Type: System.Double) (Syntax: '-Method()') Operand: IInvocationExpression ( System.Double A.Method()) (OperationKind.InvocationExpression, Type: System.Double) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1230,7 +1252,7 @@ System.Boolean Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '-Method()') Operand: IInvocationExpression ( System.Boolean A.Method()) (OperationKind.InvocationExpression, Type: System.Boolean, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -1253,7 +1275,7 @@ System.Object Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '-Method()') Operand: IInvocationExpression ( System.Object A.Method()) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -1276,7 +1298,7 @@ System.Boolean Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.BooleanLogicalNot) (OperationKind.UnaryOperatorExpression, Type: System.Boolean) (Syntax: '!i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Boolean) (Syntax: 'i') "; @@ -1297,7 +1319,7 @@ System.Boolean Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.BooleanLogicalNot) (OperationKind.UnaryOperatorExpression, Type: System.Boolean) (Syntax: '!Method()') Operand: IInvocationExpression ( System.Boolean A.Method()) (OperationKind.InvocationExpression, Type: System.Boolean) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1320,9 +1342,10 @@ System.SByte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.SByte, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -1342,9 +1365,10 @@ System.Byte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Byte, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -1364,9 +1388,10 @@ System.Int16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int16, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -1386,9 +1411,10 @@ System.UInt16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt16, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -1408,7 +1434,7 @@ System.Int32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i') "; @@ -1429,7 +1455,7 @@ System.UInt32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.UInt32) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt32) (Syntax: 'i') "; @@ -1450,7 +1476,7 @@ System.Int64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int64) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int64) (Syntax: 'i') "; @@ -1471,7 +1497,7 @@ System.UInt64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.UInt64) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.UInt64) (Syntax: 'i') "; @@ -1492,9 +1518,10 @@ System.Char Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~i') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Char, IsInvalid) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -1514,7 +1541,7 @@ System.Decimal Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Decimal, IsInvalid) (Syntax: 'i') "; @@ -1535,7 +1562,7 @@ System.Single Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Single, IsInvalid) (Syntax: 'i') "; @@ -1556,7 +1583,7 @@ System.Double Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Double, IsInvalid) (Syntax: 'i') "; @@ -1577,7 +1604,7 @@ System.Boolean Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Boolean, IsInvalid) (Syntax: 'i') "; @@ -1598,7 +1625,7 @@ System.Object Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Object, IsInvalid) (Syntax: 'i') "; @@ -1619,9 +1646,10 @@ System.SByte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.SByte A.Method()) (OperationKind.InvocationExpression, Type: System.SByte, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1643,9 +1671,10 @@ System.Byte Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Byte A.Method()) (OperationKind.InvocationExpression, Type: System.Byte, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1667,9 +1696,10 @@ System.Int16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Int16 A.Method()) (OperationKind.InvocationExpression, Type: System.Int16, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1691,9 +1721,10 @@ System.UInt16 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.UInt16 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt16, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1715,7 +1746,7 @@ System.Int32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32) (Syntax: '~Method()') Operand: IInvocationExpression ( System.Int32 A.Method()) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1738,7 +1769,7 @@ System.UInt32 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.UInt32) (Syntax: '~Method()') Operand: IInvocationExpression ( System.UInt32 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt32) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1761,7 +1792,7 @@ System.Int64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int64) (Syntax: '~Method()') Operand: IInvocationExpression ( System.Int64 A.Method()) (OperationKind.InvocationExpression, Type: System.Int64) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1784,7 +1815,7 @@ System.UInt64 Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.UInt64) (Syntax: '~Method()') Operand: IInvocationExpression ( System.UInt64 A.Method()) (OperationKind.InvocationExpression, Type: System.UInt64) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -1807,9 +1838,10 @@ System.Char Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.IntegerBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: System.Int32, IsInvalid) (Syntax: '~Method()') - Operand: IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Method()') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvocationExpression ( System.Char A.Method()) (OperationKind.InvocationExpression, Type: System.Char, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') Arguments(0) @@ -1831,7 +1863,7 @@ System.Decimal Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~Method()') Operand: IInvocationExpression ( System.Decimal A.Method()) (OperationKind.InvocationExpression, Type: System.Decimal, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -1854,7 +1886,7 @@ System.Single Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~Method()') Operand: IInvocationExpression ( System.Single A.Method()) (OperationKind.InvocationExpression, Type: System.Single, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -1877,7 +1909,7 @@ System.Double Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~Method()') Operand: IInvocationExpression ( System.Double A.Method()) (OperationKind.InvocationExpression, Type: System.Double, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -1900,7 +1932,7 @@ System.Boolean Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~Method()') Operand: IInvocationExpression ( System.Boolean A.Method()) (OperationKind.InvocationExpression, Type: System.Boolean, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -1923,7 +1955,7 @@ System.Object Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '~Method()') Operand: IInvocationExpression ( System.Object A.Method()) (OperationKind.InvocationExpression, Type: System.Object, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -1946,7 +1978,7 @@ dynamic Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DynamicPlus) (OperationKind.UnaryOperatorExpression, Type: dynamic) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: dynamic) (Syntax: 'i') "; @@ -1967,7 +1999,7 @@ dynamic Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DynamicMinus) (OperationKind.UnaryOperatorExpression, Type: dynamic) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: dynamic) (Syntax: 'i') "; @@ -1988,7 +2020,7 @@ dynamic Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DynamicBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: dynamic) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: dynamic) (Syntax: 'i') "; @@ -2009,7 +2041,7 @@ dynamic Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DynamicLogicalNot) (OperationKind.UnaryOperatorExpression, Type: dynamic) (Syntax: '!i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: dynamic) (Syntax: 'i') "; @@ -2030,7 +2062,7 @@ dynamic Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DynamicPlus) (OperationKind.UnaryOperatorExpression, Type: dynamic) (Syntax: '+Method()') Operand: IInvocationExpression ( dynamic A.Method()) (OperationKind.InvocationExpression, Type: dynamic) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2053,7 +2085,7 @@ dynamic Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DynamicMinus) (OperationKind.UnaryOperatorExpression, Type: dynamic) (Syntax: '-Method()') Operand: IInvocationExpression ( dynamic A.Method()) (OperationKind.InvocationExpression, Type: dynamic) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2076,7 +2108,7 @@ dynamic Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DynamicBitwiseNegation) (OperationKind.UnaryOperatorExpression, Type: dynamic) (Syntax: '~Method()') Operand: IInvocationExpression ( dynamic A.Method()) (OperationKind.InvocationExpression, Type: dynamic) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2099,7 +2131,7 @@ dynamic Method() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.DynamicLogicalNot) (OperationKind.UnaryOperatorExpression, Type: dynamic) (Syntax: '!Method()') Operand: IInvocationExpression ( dynamic A.Method()) (OperationKind.InvocationExpression, Type: dynamic) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2122,7 +2154,7 @@ Enum Method() } enum Enum { A, B } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: Enum, IsInvalid) (Syntax: 'i') "; @@ -2143,7 +2175,7 @@ Enum Method() } enum Enum { A, B } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: Enum, IsInvalid) (Syntax: 'i') "; @@ -2164,7 +2196,7 @@ Enum Method() } enum Enum { A, B } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: Enum) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: Enum) (Syntax: 'i') "; @@ -2185,7 +2217,7 @@ Enum Method() } enum Enum { A, B } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+Method()') Operand: IInvocationExpression ( Enum A.Method()) (OperationKind.InvocationExpression, Type: Enum, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -2208,7 +2240,7 @@ Enum Method() } enum Enum { A, B } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '-Method()') Operand: IInvocationExpression ( Enum A.Method()) (OperationKind.InvocationExpression, Type: Enum, IsInvalid) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A, IsInvalid) (Syntax: 'Method') @@ -2231,7 +2263,7 @@ Enum Method() } enum Enum { A, B } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: Enum) (Syntax: '~Method()') Operand: IInvocationExpression ( Enum A.Method()) (OperationKind.InvocationExpression, Type: Enum) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2272,7 +2304,7 @@ public struct CustomType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodPlus) (OperatorMethod: CustomType CustomType.op_UnaryPlus(CustomType x)) (OperationKind.UnaryOperatorExpression, Type: CustomType) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: CustomType) (Syntax: 'i') "; @@ -2311,7 +2343,7 @@ public struct CustomType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodMinus) (OperatorMethod: CustomType CustomType.op_UnaryNegation(CustomType x)) (OperationKind.UnaryOperatorExpression, Type: CustomType) (Syntax: '-i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: CustomType) (Syntax: 'i') "; @@ -2350,7 +2382,7 @@ public struct CustomType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodBitwiseNegation) (OperatorMethod: CustomType CustomType.op_OnesComplement(CustomType x)) (OperationKind.UnaryOperatorExpression, Type: CustomType) (Syntax: '~i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: CustomType) (Syntax: 'i') "; @@ -2389,7 +2421,7 @@ public struct CustomType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodLogicalNot) (OperatorMethod: CustomType CustomType.op_LogicalNot(CustomType x)) (OperationKind.UnaryOperatorExpression, Type: CustomType) (Syntax: '!i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: CustomType) (Syntax: 'i') "; @@ -2428,7 +2460,7 @@ public struct CustomType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodPlus) (OperatorMethod: CustomType CustomType.op_UnaryPlus(CustomType x)) (OperationKind.UnaryOperatorExpression, Type: CustomType) (Syntax: '+Method()') Operand: IInvocationExpression ( CustomType A.Method()) (OperationKind.InvocationExpression, Type: CustomType) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2469,7 +2501,7 @@ public struct CustomType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodMinus) (OperatorMethod: CustomType CustomType.op_UnaryNegation(CustomType x)) (OperationKind.UnaryOperatorExpression, Type: CustomType) (Syntax: '-Method()') Operand: IInvocationExpression ( CustomType A.Method()) (OperationKind.InvocationExpression, Type: CustomType) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2510,7 +2542,7 @@ public struct CustomType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodBitwiseNegation) (OperatorMethod: CustomType CustomType.op_OnesComplement(CustomType x)) (OperationKind.UnaryOperatorExpression, Type: CustomType) (Syntax: '~Method()') Operand: IInvocationExpression ( CustomType A.Method()) (OperationKind.InvocationExpression, Type: CustomType) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2551,7 +2583,7 @@ public struct CustomType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodLogicalNot) (OperatorMethod: CustomType CustomType.op_LogicalNot(CustomType x)) (OperationKind.UnaryOperatorExpression, Type: CustomType) (Syntax: '!Method()') Operand: IInvocationExpression ( CustomType A.Method()) (OperationKind.InvocationExpression, Type: CustomType) (Syntax: 'Method()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: A) (Syntax: 'Method') @@ -2602,7 +2634,7 @@ public void M() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (x && y) { }') Condition: IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodTrue) (OperatorMethod: System.Boolean S.op_True(S x)) (OperationKind.UnaryOperatorExpression, Type: System.Boolean) (Syntax: 'x && y') Operand: IOperation: (OperationKind.None) (Syntax: 'x && y') @@ -2657,7 +2689,7 @@ public void M() } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (x || y) { }') Condition: IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodTrue) (OperatorMethod: System.Boolean S.op_True(S x)) (OperationKind.UnaryOperatorExpression, Type: System.Boolean) (Syntax: 'x || y') Operand: IOperation: (OperationKind.None) (Syntax: 'x || y') @@ -2686,7 +2718,7 @@ public struct CustomType { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: CustomType, IsInvalid) (Syntax: 'i') "; @@ -2717,9 +2749,10 @@ public class DerivedType : BaseType { } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.OperatorMethodPlus) (OperatorMethod: BaseType BaseType.op_UnaryPlus(BaseType x)) (OperationKind.UnaryOperatorExpression, Type: BaseType) (Syntax: '+i') - Operand: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: BaseType) (Syntax: 'i') + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: BaseType) (Syntax: 'i') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: DerivedType) (Syntax: 'i') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -2753,7 +2786,7 @@ public class DerivedType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: DerivedType, IsInvalid) (Syntax: 'i') "; @@ -2788,7 +2821,7 @@ public class DerivedType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: DerivedType, IsInvalid) (Syntax: 'i') "; @@ -2816,7 +2849,7 @@ public class BaseType } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IUnaryOperatorExpression (UnaryOperationKind.Invalid) (OperationKind.UnaryOperatorExpression, Type: System.Object, IsInvalid) (Syntax: '+i') Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: BaseType, IsInvalid) (Syntax: 'i') "; @@ -2864,7 +2897,7 @@ public void M() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IOperation: (OperationKind.None) (Syntax: 'x && y') Children(2): ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'x') @@ -2926,8 +2959,9 @@ void Method() } } "; -string expectedOperationTree = @" -IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: System.Int32?) (Syntax: '(int?)1') + string expectedOperationTree = @" +IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32?) (Syntax: '(int?)1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; VerifyOperationTreeForTest(source, expectedOperationTree); @@ -2951,7 +2985,7 @@ unsafe void Method() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IPointerIndirectionReferenceExpression (OperationKind.PointerIndirectionReferenceExpression, Type: System.Int32) (Syntax: '*p2') Pointer: ILocalReferenceExpression: p2 (OperationKind.LocalReferenceExpression, Type: System.Int32*) (Syntax: 'p2') "; diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IVariableDeclaration.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IVariableDeclaration.cs index d8beffbc3b73a109db94484d1ab5af01757ddc40..b842c517304982241d28dc0ba13d3cfa89f83f25 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IVariableDeclaration.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IVariableDeclaration.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Test.Utilities; @@ -23,7 +23,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int i1;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int i1;') Variables: Local_1: System.Int32 i1 @@ -77,11 +77,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int i1 = ;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'int i1 = ;') Variables: Local_1: System.Int32 i1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) "; @@ -106,7 +107,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int i1, i2;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'i1') Variables: Local_1: System.Int32 i1 @@ -172,11 +173,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int i1 = , ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'i1 = ') Variables: Local_1: System.Int32 i1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'i2 = 2') @@ -207,7 +209,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int i,/**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'i') Variables: Local_1: System.Int32 i @@ -242,7 +244,7 @@ static void Main(string[] args) static int GetInt() => 1; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int i = Get ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'int i = Get ... **/;') Variables: Local_1: System.Int32 i @@ -269,7 +271,7 @@ static void Main(string[] args) static int GetInt() => 1; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'int i = Get ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'i = GetInt()') Variables: Local_1: System.Int32 i @@ -354,7 +356,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int[2, 3] a/**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'int[2, 3] a/**/;') Variables: Local_1: System.Int32[,] a @@ -387,7 +389,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'int[2, 3] a ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'a') Variables: Local_1: System.Int32[,] a @@ -1472,11 +1474,12 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'const /**/;') Variables: Local_1: System.Int32 i1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) "; @@ -1501,16 +1504,18 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'i1 = ') Variables: Local_1: System.Int32 i1 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'i2 = /**/') Variables: Local_1: System.Int32 i2 - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) "; @@ -1538,7 +1543,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'const /**/;') Variables: Local_1: System.Int32 i1 @@ -1568,7 +1573,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'i1') Variables: Local_1: System.Int32 i1 @@ -1607,7 +1612,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'i1') Variables: Local_1: System.Int32 i1 @@ -1648,7 +1653,7 @@ static void Main(string[] args) static int GetInt() => 1; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'const /**/;') Variables: Local_1: System.Int32 i1 @@ -1679,7 +1684,7 @@ static void Main(string[] args) static int GetInt() => 1; } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (2 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'const /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'i1 = GetInt()') Variables: Local_1: System.Int32 i1 diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidExpression.cs index 9df403ded3e9660bc3e20559fb301d3d109ef6d8..1076230f46aa48c46d7ef75034ca8732eef5d305 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidExpression.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -25,7 +25,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( ? ?.()) (OperationKind.InvocationExpression, Type: ?, IsInvalid) (Syntax: 'Console.WriteLine2()') Instance Receiver: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'Console.WriteLine2') Children(1): @@ -59,7 +59,7 @@ void F(int x) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvocationExpression ( void Program.F(System.Int32 x)) (OperationKind.InvocationExpression, Type: System.Void, IsInvalid) (Syntax: 'F(string.Empty)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: Program) (Syntax: 'F') Arguments(1): @@ -128,7 +128,7 @@ void F() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'var y /**/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'var y /**/;') Variables: Local_1: ? y @@ -165,11 +165,12 @@ void F() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'string y /* ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'string y /* ... **/;') Variables: Local_1: System.String y - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: 'x.i1') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: 'x.i1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: System.Int32 Program.i1 (OperationKind.FieldReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'x.i1') Instance Receiver: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: Program, IsInvalid) (Syntax: 'x') "; @@ -205,11 +206,12 @@ void F() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Program y / ... **/;') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration, IsInvalid) (Syntax: 'Program y / ... **/;') Variables: Local_1: Program y - Initializer: IConversionExpression (ConversionKind.Invalid, Explicit) (OperationKind.ConversionExpression, Type: Program, IsInvalid) (Syntax: '(Program)x.i1') + Initializer: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Program, IsInvalid) (Syntax: '(Program)x.i1') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: System.Int32 Program.i1 (OperationKind.FieldReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'x.i1') Instance Receiver: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: Program, IsInvalid) (Syntax: 'x') "; @@ -277,7 +279,7 @@ void F() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IBinaryOperatorExpression (BinaryOperationKind.Invalid) (OperationKind.BinaryOperatorExpression, Type: ?, IsInvalid) (Syntax: 'x + (y * args.Length)') Left: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: Program) (Syntax: 'x') Right: IBinaryOperatorExpression (BinaryOperationKind.Invalid) (OperationKind.BinaryOperatorExpression, Type: ?, IsInvalid) (Syntax: 'y * args.Length') @@ -349,7 +351,7 @@ static void F() } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ILambdaExpression (Signature: lambda expression) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: '() => F()') IBlockStatement (1 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'F()') IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'F()') @@ -379,9 +381,10 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IFieldInitializer (Field: System.Int32 Program.x) (OperationKind.FieldInitializer, IsInvalid) (Syntax: '= Program') - IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Program') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Program') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: Program, IsInvalid) (Syntax: 'Program') Children(1): IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Program') @@ -410,19 +413,22 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IArrayInitializer (2 elements) (OperationKind.ArrayInitializer, IsInvalid) (Syntax: '{ { { 1, 1 ... { 2, 2 } }') Element Values(2): IArrayInitializer (1 elements) (OperationKind.ArrayInitializer, IsInvalid) (Syntax: '{ { 1, 1 } }') Element Values(1): - IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '{ 1, 1 }') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '{ 1, 1 }') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '{ 1, 1 }') Children(1): IArrayInitializer (2 elements) (OperationKind.ArrayInitializer, IsInvalid) (Syntax: '{ 1, 1 }') Element Values(2): - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: '1') - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: '1') IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '{ 2, 2 }') Element Values(2): @@ -453,7 +459,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IArrayCreationExpression (Element Type: X) (OperationKind.ArrayCreationExpression, Type: X[], IsInvalid) (Syntax: 'new X[Program] { { 1 } }') Dimension Sizes(1): IInvalidExpression (OperationKind.InvalidExpression, Type: Program, IsInvalid) (Syntax: 'Program') @@ -461,12 +467,14 @@ static void Main(string[] args) IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Program') Initializer: IArrayInitializer (1 elements) (OperationKind.ArrayInitializer, IsInvalid) (Syntax: '{ { 1 } }') Element Values(1): - IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: X, IsInvalid) (Syntax: '{ 1 }') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: X, IsInvalid) (Syntax: '{ 1 }') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '{ 1 }') Children(1): IArrayInitializer (1 elements) (OperationKind.ArrayInitializer, IsInvalid) (Syntax: '{ 1 }') Element Values(1): - IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: '1') "; var expectedDiagnostics = new DiagnosticDescription[] { diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidStatement.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidStatement.cs index 2237f9f37f25940beaab47f7e8479f406b69fd78..597c9c4d914b75c78aaf12b3bf43adcb1d3a3475 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidStatement.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidStatement.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// 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 Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -103,7 +103,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" ISwitchStatement (1 cases) (OperationKind.SwitchStatement, IsInvalid) (Syntax: 'switch (x.T ... }') Switch expression: IInvocationExpression (virtual System.String System.Object.ToString()) (OperationKind.InvocationExpression, Type: System.String) (Syntax: 'x.ToString()') Instance Receiver: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: Program) (Syntax: 'x') @@ -112,7 +112,8 @@ static void Main(string[] args) ISwitchCase (1 case clauses, 1 statements) (OperationKind.SwitchCase, IsInvalid) (Syntax: 'case 1: ... break;') Clauses: ISingleValueCaseClause (Equality operator kind: BinaryOperationKind.StringEquals) (CaseKind.SingleValue) (OperationKind.SingleValueCaseClause, IsInvalid) (Syntax: 'case 1:') - Value: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: '1') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: '1') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: '1') Body: IBranchStatement (BranchKind.Break) (OperationKind.BranchStatement) (Syntax: 'break;') @@ -143,12 +144,14 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement, IsInvalid) (Syntax: 'if (x = nul ... }') - Condition: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x = null') + Condition: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x = null') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: Program, IsInvalid) (Syntax: 'x = null') Left: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: Program, IsInvalid) (Syntax: 'x') - Right: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: Program, Constant: null, IsInvalid) (Syntax: 'null') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Program, Constant: null, IsInvalid) (Syntax: 'null') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: True, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null, IsInvalid) (Syntax: 'null') IfTrue: IBlockStatement (0 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IfFalse: null @@ -181,14 +184,16 @@ static void Main(string[] args) /**/ } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement, IsInvalid) (Syntax: 'if () ... else') - Condition: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: '') + Condition: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) IfTrue: IBlockStatement (0 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IfFalse: IIfStatement (OperationKind.IfStatement, IsInvalid) (Syntax: 'if (x) x; ... else') - Condition: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x') + Condition: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: Program, IsInvalid) (Syntax: 'x') IfTrue: IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'x;') Expression: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: Program, IsInvalid) (Syntax: 'x') @@ -234,9 +239,10 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IForLoopStatement (LoopKind.For) (OperationKind.LoopStatement, IsInvalid) (Syntax: 'for (P; x;) ... }') - Condition: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x') + Condition: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'x') + Conversion: CommonConversion (Exists: True, IsIdentity: True, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: x (OperationKind.LocalReferenceExpression, Type: Program, IsInvalid) (Syntax: 'x') Before: IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'P') @@ -279,7 +285,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvalidStatement (OperationKind.InvalidStatement, IsInvalid) (Syntax: 'goto case 1;') Children(1): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: '1') @@ -334,7 +340,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvalidStatement (OperationKind.InvalidStatement, IsInvalid) (Syntax: 'break;') Children(0) "; @@ -361,7 +367,7 @@ static void Main(string[] args) } } "; -string expectedOperationTree = @" + string expectedOperationTree = @" IInvalidStatement (OperationKind.InvalidStatement, IsInvalid) (Syntax: 'continue;') Children(0) "; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ObjectAndCollectionInitializerTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ObjectAndCollectionInitializerTests.cs index 024ee3cf3e7b1a74c91c3206d438e97b6cecf7c1..04d6cca03732dda47f6f8604a2fa406e6d04a9a4 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ObjectAndCollectionInitializerTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ObjectAndCollectionInitializerTests.cs @@ -194,7 +194,8 @@ public static void Main() ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: dynamic) (Syntax: 'X = 0') Left: IFieldReferenceExpression: dynamic MemberInitializerTest.X (OperationKind.FieldReferenceExpression, Type: dynamic) (Syntax: 'X') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: MemberInitializerTest) (Syntax: 'X') - Right: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: dynamic) (Syntax: '0') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: dynamic) (Syntax: '0') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -415,23 +416,28 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() Initializers(5): ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '1') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '2') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 2) (Syntax: '2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 2) (Syntax: '2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '3') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 3) (Syntax: '3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 3) (Syntax: '3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '4') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 4) (Syntax: '4') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 4) (Syntax: '4') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '5') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 5) (Syntax: '5') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 5) (Syntax: '5') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -501,23 +507,28 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() Initializers(5): ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '1') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 1) (Syntax: '1') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 1) (Syntax: '1') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '2') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 2) (Syntax: '2') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 2) (Syntax: '2') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '3') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 3) (Syntax: '3') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 3) (Syntax: '3') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 3) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 3) (Syntax: '3') ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '4') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 4) (Syntax: '4') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 4) (Syntax: '4') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 4) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 4) (Syntax: '4') ICollectionElementInitializerExpression (AddMethod: void B.Add(System.Int64 i)) (IsDynamic: False) (OperationKind.CollectionElementInitializerExpression, Type: System.Void) (Syntax: '5') Arguments(1): - IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 5) (Syntax: '5') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64, Constant: 5) (Syntax: '5') + Conversion: CommonConversion (Exists: True, IsIdentity: False, IsNumeric: True, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 5) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 5) (Syntax: '5') "; var expectedDiagnostics = DiagnosticDescription.None; diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicConversionExpression.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicConversionExpression.vb index 7a0b4a88d7d401d7c8a511d286edc7fae24dd701..0a8eb7539e82d5240f1d1b4c080aa3ddf2da07ed 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicConversionExpression.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicConversionExpression.vb @@ -37,13 +37,17 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Private ReadOnly _operandLazy As Lazy(Of IOperation) - Public Sub New(operand As Lazy(Of IOperation), conversion As Conversion, isExplicitInCode As Boolean, isTryCast As Boolean, isChecked As Boolean, syntax As SyntaxNode, type As ITypeSymbol, constantValue As [Optional](Of Object)) + Public Sub New(operandLazy As Lazy(Of IOperation), conversion As Conversion, isExplicitInCode As Boolean, isTryCast As Boolean, isChecked As Boolean, syntax As SyntaxNode, type As ITypeSymbol, constantValue As [Optional](Of Object)) MyBase.New(conversion, isExplicitInCode, isTryCast, isChecked, syntax, type, constantValue) - _operandLazy = operand + _operandLazy = operandLazy End Sub - Public Overrides ReadOnly Property Operand As IOperation = _operandLazy.Value + Public Overrides ReadOnly Property Operand As IOperation + Get + Return _operandLazy.Value + End Get + End Property End Class Public Module IConversionExpressionExtensions diff --git a/src/Compilers/VisualBasic/Test/Semantic/Binding/BindingObjectInitializerTests.vb b/src/Compilers/VisualBasic/Test/Semantic/Binding/BindingObjectInitializerTests.vb index b698afdfa3ff77db147b5701da9c081164bde74d..2b29f6384a1943b403aae5a24211a889c22dcfcc 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/Binding/BindingObjectInitializerTests.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/Binding/BindingObjectInitializerTests.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Linq.Enumerable Imports System.Xml.Linq @@ -199,7 +199,8 @@ IObjectCreationExpression (Constructor: Sub C2..ctor()) (OperationKind.ObjectCre ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int32, IsInvalid) (Syntax: '.Field') Left: IFieldReferenceExpression: C2.Field As System.Int32 (OperationKind.FieldReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'Field') Instance Receiver: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C2() With {.Field}') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) ]]>.Value @@ -241,7 +242,8 @@ IObjectCreationExpression (Constructor: Sub C2..ctor()) (OperationKind.ObjectCre ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int32, IsInvalid) (Syntax: '.Field =') Left: IFieldReferenceExpression: C2.Field As System.Int32 (OperationKind.FieldReferenceExpression, Type: System.Int32) (Syntax: 'Field') Instance Receiver: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C2() With {.Field =}') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) ]]>.Value @@ -406,7 +408,7 @@ Class C1 Dim c1 as New C1() With {.Field2 = .Field1} Console.WriteLine(c1.Field2) End Sub -End Class +End Class @@ -531,7 +533,8 @@ IObjectCreationExpression (Constructor: Sub C2..ctor()) (OperationKind.ObjectCre IInvalidExpression (OperationKind.InvalidExpression, Type: System.Int32, IsInvalid) (Syntax: 'Field') Children(1): IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C2() Wi ... Field = 23}') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: ?) (Syntax: '23') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: ?) (Syntax: '23') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (Text: 23) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 23) (Syntax: '23') ]]>.Value @@ -570,7 +573,8 @@ IObjectCreationExpression (Constructor: Sub C1..ctor()) (OperationKind.ObjectCre Left: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.Foo = "Hello World!"') Children(1): IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Foo') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: ?) (Syntax: '"Hello World!"') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: ?) (Syntax: '"Hello World!"') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Hello World!") (Syntax: '"Hello World!"') ]]>.Value @@ -647,7 +651,8 @@ IObjectCreationExpression (Constructor: Sub C1..ctor()) (OperationKind.ObjectCre Children(1): IFieldReferenceExpression: C1.X As System.String (OperationKind.FieldReferenceExpression, Type: System.String, IsInvalid) (Syntax: 'X') Instance Receiver: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C1() Wi ... lo World!"}') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: ?) (Syntax: '"Hello World!"') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: ?) (Syntax: '"Hello World!"') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Hello World!") (Syntax: '"Hello World!"') ]]>.Value @@ -734,7 +739,8 @@ IBlockStatement (4 statements, 1 locals) (OperationKind.BlockStatement, IsInvali IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'X') Children(1): IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C3() Wi ... .X = "foo"}') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: ?) (Syntax: '"foo"') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: ?) (Syntax: '"foo"') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "foo") (Syntax: '"foo"') IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'x = New C3( ... Unknown()}') Expression: ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: C3, IsInvalid) (Syntax: 'x = New C3( ... Unknown()}') @@ -883,7 +889,7 @@ Class C2 Console.WriteLine(y.Field) ' should be 42 End With End Sub -End Class +End Class @@ -941,7 +947,8 @@ IObjectCreationExpression (Constructor: Sub C1..ctor()) (OperationKind.ObjectCre ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int32, IsInvalid) (Syntax: '.Field = .Field2') Left: IFieldReferenceExpression: C1.Field As System.Int32 (OperationKind.FieldReferenceExpression, Type: System.Int32) (Syntax: 'Field') Instance Receiver: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C1() Wi ... = .Field2}') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '.Field2') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '.Field2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.Field2') Children(1): IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C1() Wi ... = .Field2}') @@ -980,7 +987,7 @@ Class C3 Console.WriteLine(x.Field) Console.WriteLine(x.FieldC2.Field) End Sub -End Class +End Class @@ -1057,7 +1064,8 @@ IObjectCreationExpression (Constructor: Sub C1..ctor()) (OperationKind.ObjectCre ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int32, IsInvalid) (Syntax: '.Field1 = .Field2') Left: IFieldReferenceExpression: C2.Field1 As System.Int32 (OperationKind.FieldReferenceExpression, Type: System.Int32) (Syntax: 'Field1') Instance Receiver: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C2() Wi ... = .Field2}') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '.Field2') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: '.Field2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.Field2') Children(1): IOperation: (OperationKind.None, IsInvalid) (Syntax: 'New C2() Wi ... = .Field2}') @@ -1099,7 +1107,7 @@ Class C2 x.Field = 42 Console.WriteLine(x.Field2.Invoke()) End Sub -End Class +End Class @@ -1115,7 +1123,8 @@ IObjectCreationExpression (Constructor: Sub C1..ctor()) (OperationKind.ObjectCre ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Func(Of System.Int32)) (Syntax: '.Field2 = F ... nd Function') Left: IFieldReferenceExpression: C1.Field2 As System.Func(Of System.Int32) (OperationKind.FieldReferenceExpression, Type: System.Func(Of System.Int32)) (Syntax: 'Field2') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'New C1 With ... d Function}') - Right: IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32)) (Syntax: 'Function() ... nd Function') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32)) (Syntax: 'Function() ... nd Function') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Function() ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement) (Syntax: 'Function() ... nd Function') Locals: Local_1: As System.Int32 @@ -1201,7 +1210,7 @@ End Class AssertTheseDiagnostics(compilation, BC42104: Variable 'y' is used before it has been assigned a value. A null reference exception could result at runtime. Dim x As New C1 With {.RefTypeField = y.CreateC2} - ~ + ~ ) ' Yeah! We did not have this in Dev10 :) End Sub @@ -1384,12 +1393,14 @@ IObjectCreationExpression (Constructor: Sub C2..ctor()) (OperationKind.ObjectCre ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Func(Of System.Object)) (Syntax: '.Field = Fu ... nd Function') Left: IFieldReferenceExpression: C2.Field As System.Func(Of System.Object) (OperationKind.FieldReferenceExpression, Type: System.Func(Of System.Object)) (Syntax: 'Field') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'As New C2 W ... d Function}') - Right: IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Object)) (Syntax: 'Function()' ... nd Function') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Object)) (Syntax: 'Function()' ... nd Function') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.Object) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Function()' ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement) (Syntax: 'Function()' ... nd Function') Locals: Local_1: As System.Object IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Return .Field') - ReturnedValue: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '.Field') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '.Field') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: C2.Field As System.Func(Of System.Object) (OperationKind.FieldReferenceExpression, Type: System.Func(Of System.Object)) (Syntax: '.Field') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'As New C2 W ... d Function}') ILabelStatement (Label: exit) (OperationKind.LabelStatement) (Syntax: 'End Function') @@ -1399,12 +1410,14 @@ IObjectCreationExpression (Constructor: Sub C2..ctor()) (OperationKind.ObjectCre ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Func(Of System.Object)) (Syntax: '.Field2 = F ... nd Function') Left: IFieldReferenceExpression: C2.Field2 As System.Func(Of System.Object) (OperationKind.FieldReferenceExpression, Type: System.Func(Of System.Object)) (Syntax: 'Field2') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'As New C2 W ... d Function}') - Right: IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Object)) (Syntax: 'Function() ... nd Function') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Object)) (Syntax: 'Function() ... nd Function') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.Object) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Function() ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement) (Syntax: 'Function() ... nd Function') Locals: Local_1: As System.Object IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'Return .Field') - ReturnedValue: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '.Field') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '.Field') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IFieldReferenceExpression: C2.Field As System.Func(Of System.Object) (OperationKind.FieldReferenceExpression, Type: System.Func(Of System.Object)) (Syntax: '.Field') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'As New C2 W ... d Function}') ILabelStatement (Label: exit) (OperationKind.LabelStatement) (Syntax: 'End Function') @@ -1450,7 +1463,8 @@ IObjectCreationExpression (Constructor: Sub cust..ctor()) (OperationKind.ObjectC ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int64) (Syntax: '.x = !a') Left: IFieldReferenceExpression: cust.x As System.Int64 (OperationKind.FieldReferenceExpression, Type: System.Int64) (Syntax: 'x') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'New cust With {.x = !a}') - Right: IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: '!a') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int64) (Syntax: '!a') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IPropertyReferenceExpression: ReadOnly Property cust.scen5(arg As System.String) As System.Int32 (OperationKind.PropertyReferenceExpression, Type: System.Int32) (Syntax: '!a') Instance Receiver: IOperation: (OperationKind.None) (Syntax: 'New cust With {.x = !a}') Arguments(1): @@ -1494,7 +1508,8 @@ Class C2 End Class]]>.Value Dim expectedOperationTree = .Value @@ -1526,7 +1542,7 @@ End Class Class C2 Public Shared Sub Main() - Dim c As Cust = New Cust With {.y = 1, + Dim c As Cust = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, .x = New Cust With {.y = 1, @@ -1557,7 +1573,7 @@ Class C2 }}}}}}}}}} }}}}}}}}}} End Sub -End Class +End Class @@ -1781,7 +1797,7 @@ Public Module Module1 Try '<><%= ======================================================================================= %=> Dim cust = New Cust With {.Cust = 1, .Name = .Value, .e = .(0)} - Dim cust2 = New Cust With {.Cust = 1, .Name = .Name, .e = ...(0)} + Dim cust2 = New Cust With {.Cust = 1, .Name = .Name, .e = ...(0)} Console.writeline("Scenario 8") Console.writeline(.ToString) Console.writeline( cust.e.ToString) diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb index 3ff49c59ae8b9659a48d141535408328b12783e6..6d7b8ecae96d77d399b053b04dc86894b961a5cb 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb @@ -16,24 +16,24 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Semantics .Value -Dim expectedOperationTree = 0 T ... End If') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerNotEquals) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'x <> 0') Left: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') @@ -277,7 +277,8 @@ IForLoopStatement (LoopKind.For) (OperationKind.LoopStatement) (Syntax: 'For i = IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'For i = 0 T ... Next') Expression: ICompoundAssignmentExpression (BinaryOperationKind.IntegerAdd) (OperationKind.CompoundAssignmentExpression, Type: System.Int32) (Syntax: 'For i = 0 T ... Next') Left: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i') - Right: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: 'For i = 0 T ... Next') + Right: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 1) (Syntax: 'For i = 0 T ... Next') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'For i = 0 T ... Next') Body: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'For i = 0 T ... Next') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Console.Write(i)') @@ -302,7 +303,7 @@ IForLoopStatement (LoopKind.For) (OperationKind.LoopStatement) (Syntax: 'For i = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -641,7 +644,7 @@ Class P End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -44,11 +45,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -68,11 +70,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -96,11 +99,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -123,11 +127,12 @@ Module Program End Enum End Module]]>.Value -Dim expectedOperationTree = .Value @@ -151,11 +156,12 @@ Module Program End Enum End Module]]>.Value -Dim expectedOperationTree = .Value @@ -183,11 +189,12 @@ Module Program End Enum End Module]]>.Value -Dim expectedOperationTree = .Value @@ -213,11 +220,12 @@ Module Program End Enum End Module]]>.Value -Dim expectedOperationTree = .Value @@ -245,11 +253,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -274,11 +283,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -346,11 +357,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -376,11 +388,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -404,11 +417,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -428,11 +442,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -453,11 +468,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -489,11 +505,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -520,11 +537,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -556,11 +574,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -587,11 +606,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -621,11 +641,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -653,7 +674,8 @@ End Module]]>.Value IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Dim o As Object = i') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'o') Variables: Local_1: o As System.Object - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'i') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'i') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: Program.I1) (Syntax: 'i') ]]>.Value @@ -682,11 +704,12 @@ Module Program End Interface End Module]]>.Value -Dim expectedOperationTree = .Value @@ -708,11 +731,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = As System.Int32 @@ -845,7 +872,8 @@ End Module]]>.Value IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement) (Syntax: 'Dim a As Ac ... nd Function') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'a') Variables: Local_1: a As System.Action(Of System.Int32) - Initializer: IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Action(Of System.Int32)) (Syntax: 'Function() ... nd Function') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action(Of System.Int32)) (Syntax: 'Function() ... nd Function') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Function() ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement) (Syntax: 'Function() ... nd Function') Locals: Local_1: As System.Int32 @@ -879,7 +907,8 @@ End Module]]>.Value IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Dim a As Fu ... End Sub') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'a') Variables: Local_1: a As System.Func(Of System.Int32) - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32), IsInvalid) (Syntax: 'Sub()'BIND: ... End Sub') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.Int32), IsInvalid) (Syntax: 'Sub()'BIND: ... End Sub') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Sub ()) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Sub()'BIND: ... End Sub') IBlockStatement (2 statements) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Sub()'BIND: ... End Sub') ILabelStatement (Label: exit) (OperationKind.LabelStatement, IsInvalid) (Syntax: 'End Sub') @@ -966,7 +995,8 @@ End Module]]>.Value IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Dim a As Ac ... ddressOf M2') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'a') Variables: Local_1: a As System.Action - Initializer: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: 'AddressOf M2') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Action, IsInvalid) (Syntax: 'AddressOf M2') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'AddressOf M2') ]]>.Value @@ -1047,11 +1077,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1079,11 +1110,12 @@ Module Program End Function End Module]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -1243,11 +1279,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1279,11 +1316,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1316,11 +1354,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1348,11 +1387,12 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1383,11 +1423,12 @@ Module Program End Structure End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1411,11 +1452,12 @@ Module Program End Structure End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1442,11 +1484,12 @@ Module Program End Structure End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1469,11 +1512,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1494,11 +1538,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1517,11 +1562,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1549,11 +1595,12 @@ Module Program End Structure End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1573,11 +1620,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -1641,11 +1690,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1675,11 +1725,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1709,11 +1760,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1747,11 +1799,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1774,11 +1827,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1801,11 +1855,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1832,11 +1887,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1860,11 +1916,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1892,11 +1949,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1924,13 +1982,14 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -1967,11 +2026,12 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = As System.Boolean @@ -2005,16 +2065,18 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = As System.Boolean IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'num') - ReturnedValue: IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'num') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Boolean, IsInvalid) (Syntax: 'num') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IParameterReferenceExpression: num (OperationKind.ParameterReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'num') ILabelStatement (Label: exit) (OperationKind.LabelStatement, IsInvalid) (Syntax: 'Function(num) num') LabeledStatement: null @@ -2045,9 +2107,10 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -2070,9 +2133,10 @@ Module Module1 End Module ]]>.Value -Dim expectedOperationTree = .Value @@ -2096,11 +2160,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -2160,12 +2227,14 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value @@ -2196,14 +2265,18 @@ Module Program End Class End Module]]>.Value -Dim expectedOperationTree = .Value diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IFieldReferenceExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IFieldReferenceExpression.vb index 91982e7ecefd82ea45b1b3e4918a1ab5e4fb849e..42c309921f62d11690091caaef029056daea84bf 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IFieldReferenceExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IFieldReferenceExpression.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.Semantics Imports Microsoft.CodeAnalysis.Test.Utilities @@ -23,7 +23,7 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = ... lue = count') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'count > 0') Left: ILocalReferenceExpression: count (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'count') @@ -51,7 +51,7 @@ Module Program End Module ]]>.Value -Dim expectedOperationTree = ... End If') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'count > 0') Left: ILocalReferenceExpression: count (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'count') @@ -80,7 +80,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = ... ata - count') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'count > 10') Left: ILocalReferenceExpression: count (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'count') @@ -118,7 +118,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = 10 T ... rnValue = n') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 10') Left: ILocalReferenceExpression: m (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'm') @@ -154,7 +154,7 @@ Class P End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = 10 ... rnValue = n') Condition: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Boolean) (Syntax: '(m > 10 And n > 20)') Operand: IBinaryOperatorExpression (BinaryOperationKind.BooleanAnd) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 10 And n > 20') @@ -250,7 +250,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = ... End If') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'count > 0') Left: ILocalReferenceExpression: count (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'count') @@ -292,7 +292,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = 10) ... End If') Condition: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Boolean) (Syntax: '(m > 10)') Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 10') @@ -349,7 +349,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = 10) ... End If') Condition: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Boolean) (Syntax: '(m > 10)') Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 10') @@ -403,7 +403,7 @@ Module Program End Module ]]>.Value -Dim expectedOperationTree = = n ... End If') Condition: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Boolean) (Syntax: '(m >= n AndAlso m >= p)') Operand: IBinaryOperatorExpression (BinaryOperationKind.BooleanConditionalAnd) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm >= n AndAlso m >= p') @@ -448,7 +448,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = 20) ... End If') Condition: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Boolean) (Syntax: '(m > 20)') Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 20') @@ -504,7 +504,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = 20) ... ("Result3")') Condition: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Boolean) (Syntax: '(m > 20)') Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 20') @@ -567,7 +567,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = 20) ... Else') Condition: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Boolean, IsInvalid) (Syntax: '(m > 20)') Operand: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean, IsInvalid) (Syntax: 'm > 20') @@ -607,9 +607,10 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -40,7 +40,7 @@ Friend Class [Class] End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = , )(keySelector As System.Func(Of System.String, ), resultSelector As System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) As System.Collections.Generic.IEnumerable(Of )) (OperationKind.InvocationExpression, Type: System.Collections.Generic.IEnumerable(Of )) (Syntax: 'Group By w ... nto Count()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'y In x') + Instance Receiver: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Collections.Generic.IEnumerable(Of System.String)) (Syntax: 'y In x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 'y In x') Children(1): IOperation: (OperationKind.None) (Syntax: 'x') @@ -240,7 +247,8 @@ IOperation: (OperationKind.None) (Syntax: 'From y In x ... nto Count()') IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.String()) (Syntax: 'x') Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: keySelector) (OperationKind.Argument) (Syntax: 'x') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String, )) (Syntax: 'x') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String, )) (Syntax: 'x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 'x') Children(1): IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') @@ -254,7 +262,8 @@ IOperation: (OperationKind.None) (Syntax: 'From y In x ... nto Count()') InConversion: null OutConversion: null IArgument (ArgumentKind.DefaultValue, Matching Parameter: resultSelector) (OperationKind.Argument) (Syntax: 'Group By w ... nto Count()') - IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) (Syntax: 'Group By w ... nto Count()') + IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of , System.Collections.Generic.IEnumerable(Of System.String), )) (Syntax: 'Group By w ... nto Count()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None) (Syntax: 'Group By w ... nto Count()') Children(1): IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: ) (Syntax: 'Group By w ... nto Count()') @@ -298,7 +307,7 @@ Friend Class [Class] End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = As System.Object @@ -389,8 +399,9 @@ Class Class1 End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -485,11 +496,12 @@ Class Class1 End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -535,11 +547,12 @@ Class Class1 End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -598,7 +611,7 @@ Friend Class [Class] End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -815,7 +829,7 @@ End Structure sources1, references:={MscorlibRef, SystemRef, compilation0.EmitToImageReference(embedInteropTypes:=True)}) -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -55,7 +55,7 @@ Class C End Function End Class]]>.Value -Dim expectedOperationTree = .Value @@ -75,7 +75,7 @@ Class C End Function End Class]]>.Value -Dim expectedOperationTree = .Value diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.vb index 67e81d07ca9c7f13a600fa18262ab8c098c8e71f..caa9850231d892b5156b6304a84aa73c4911a3ec 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.Semantics Imports Microsoft.CodeAnalysis.Test.Utilities @@ -120,9 +120,10 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ITupleExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ITupleExpression.vb index 3633f2605f36097b67181ab916349bb6cd877a20..5420368910997b095340f6bcb008f1667eabc86b 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ITupleExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_ITupleExpression.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Roslyn.Test.Utilities @@ -68,13 +68,16 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -94,16 +97,19 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -123,13 +129,16 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -149,16 +158,19 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -230,8 +242,9 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -310,16 +327,19 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -356,12 +376,15 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -407,15 +432,18 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -457,14 +487,18 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -497,17 +531,21 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -540,9 +578,11 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -575,12 +615,14 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -615,10 +657,11 @@ Class C End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -668,13 +713,14 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.vb index a3390d2b7d1abdd16ac8c6c924ccd95ce37cedef..6363c612f8bfbf532b9384813890b23031c836af 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IUnaryOperatorExpression.vb @@ -20,7 +20,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -40,7 +40,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -60,7 +60,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -80,7 +80,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -100,7 +100,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -120,7 +120,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -140,7 +140,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -160,7 +160,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -180,7 +180,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -200,7 +200,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -220,7 +220,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -240,7 +240,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -260,7 +260,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -280,7 +280,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -300,7 +300,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -320,7 +320,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -340,7 +340,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -360,7 +360,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -380,7 +380,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -400,7 +400,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -420,7 +420,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -440,7 +440,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -460,7 +460,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -480,7 +480,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -500,7 +500,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -520,7 +520,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -540,7 +540,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -560,7 +560,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -580,7 +580,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -600,7 +600,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value @@ -620,7 +620,7 @@ End Class ]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -1308,10 +1310,12 @@ B End Enum ]]>.Value -Dim expectedOperationTree = .Value @@ -1333,7 +1337,7 @@ B End Enum ]]>.Value -Dim expectedOperationTree = .Value @@ -1356,10 +1360,12 @@ B End Enum ]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -1480,7 +1488,7 @@ End CLass ]]>.Value -Dim expectedOperationTree = .Value @@ -1514,7 +1522,7 @@ End CLass ]]>.Value -Dim expectedOperationTree = .Value @@ -1548,7 +1556,7 @@ End CLass ]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -1766,9 +1775,10 @@ Public Class DerivedType Inherits BaseType End Class]]>.Value -Dim expectedOperationTree = .Value @@ -1797,8 +1807,9 @@ Public Class DerivedType End Operator End Class]]>.Value -Dim expectedOperationTree = .Value @@ -1828,8 +1839,9 @@ Public Class DerivedType End Operator End Class]]>.Value -Dim expectedOperationTree = .Value @@ -1854,7 +1866,8 @@ Public Class BaseType End Class]]>.Value Dim expectedOperationTree = .Value diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IVariableDeclaration.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IVariableDeclaration.vb index a5857ceb5afbd2b3e5d5c3212e885c22f61cb0f2..189a1ff43ab00037a49ef055561ac10c56c05aaa 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IVariableDeclaration.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IVariableDeclaration.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Microsoft.CodeAnalysis.Semantics @@ -1208,11 +1208,12 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1230,15 +1231,17 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value @@ -1307,11 +1310,12 @@ Module Program End Function End Module]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -1466,16 +1473,18 @@ Module Program End Function End Module]]>.Value -Dim expectedOperationTree = .Value diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb index 50b2399f8007fbe9d7595da29ec1c8c9664f7bc6..30168103b57b7e760af2dde052dc4100af9f9cbb 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.Semantics Imports Microsoft.CodeAnalysis.Test.Utilities @@ -21,7 +21,7 @@ Class Program End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -171,8 +173,9 @@ Class Program End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -201,7 +204,7 @@ Class Program End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -230,7 +233,7 @@ Class Program End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = () As ?, IsInvalid) (Syntax: 'Function() F()') + Dim expectedOperationTree = () As ?, IsInvalid) (Syntax: 'Function() F()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As ?) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Function() F()') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Function() F()') Locals: Local_1: As ? @@ -306,9 +310,10 @@ Class Program End Sub End Class]]>.Value -Dim expectedOperationTree = .Value @@ -359,11 +364,12 @@ Class Program End Sub End Class]]>.Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value -Dim expectedOperationTree = .Value @@ -261,19 +267,22 @@ IForLoopStatement (LoopKind.For) (OperationKind.LoopStatement, IsInvalid) (Synta IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: '') Expression: ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Object, IsInvalid) (Syntax: '') Left: ILocalReferenceExpression: (OperationKind.LocalReferenceExpression, Type: System.Object, IsInvalid) (Syntax: '') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: '') Expression: ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Object, IsInvalid) (Syntax: '') Left: ISyntheticLocalReferenceExpression (SynthesizedLocalKind.ForLoopLimitValue) (OperationKind.SyntheticLocalReferenceExpression, Type: System.Object, IsInvalid) (Syntax: '') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: '') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') Children(0) IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'For Step (M ... Next') Expression: ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Object, IsInvalid) (Syntax: 'For Step (M ... Next') Left: ISyntheticLocalReferenceExpression (SynthesizedLocalKind.ForLoopStepValue) (OperationKind.SyntheticLocalReferenceExpression, Type: System.Object, IsInvalid) (Syntax: 'For Step (M ... Next') - Right: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'For Step (M ... Next') + Right: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'For Step (M ... Next') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1, IsInvalid) (Syntax: 'For Step (M ... Next') AtLoopBottom: IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'For Step (M ... Next') @@ -331,12 +340,14 @@ IForLoopStatement (LoopKind.For) (OperationKind.LoopStatement, IsInvalid) (Synta IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'Program') Expression: ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int32, IsInvalid) (Syntax: 'Program') Left: ISyntheticLocalReferenceExpression (SynthesizedLocalKind.ForLoopLimitValue) (OperationKind.SyntheticLocalReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'Program') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Program') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'Program') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IOperation: (OperationKind.None, IsInvalid) (Syntax: 'Program') IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: 'x') Expression: ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int32, IsInvalid) (Syntax: 'x') Left: ISyntheticLocalReferenceExpression (SynthesizedLocalKind.ForLoopStepValue) (OperationKind.SyntheticLocalReferenceExpression, Type: System.Int32, IsInvalid) (Syntax: 'x') - Right: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'x') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Int32, IsInvalid) (Syntax: 'x') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: 'x') Children(0) AtLoopBottom: @@ -472,7 +483,7 @@ Module Program End Sub End Module]]>.Value -Dim expectedOperationTree = .Value Dim expectedOperationTree = ) (Syntax: 'New With {. ... = .b + .a}') Initializers(3): ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int32, Constant: 1) (Syntax: '.a = 1') @@ -56,7 +57,8 @@ Module ModuleA End Module]]>.Value Dim expectedOperationTree = , IsInvalid) (Syntax: 'New With {. ... s, .b = .a}') Initializers(2): ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: ?, IsInvalid) (Syntax: '.a = sss') @@ -97,7 +99,8 @@ IBlockStatement (4 statements, 2 locals) (OperationKind.BlockStatement, IsInvali IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Dim v1 As O ... h {.a = tr}') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'v1') Variables: Local_1: v1 As System.Object - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'New With {.a = tr}') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'New With {.a = tr}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , IsInvalid) (Syntax: 'New With {.a = tr}') Initializers(1): ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.TypedReference, IsInvalid) (Syntax: '.a = tr') @@ -107,7 +110,8 @@ IBlockStatement (4 statements, 2 locals) (OperationKind.BlockStatement, IsInvali IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclarationStatement, IsInvalid) (Syntax: 'Dim v2 As O ... a = {{tr}}}') IVariableDeclaration (1 variables) (OperationKind.VariableDeclaration) (Syntax: 'v2') Variables: Local_1: v2 As System.Object - Initializer: IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'New With {.a = {{tr}}}') + Initializer: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, IsInvalid) (Syntax: 'New With {.a = {{tr}}}') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpression, Type: , IsInvalid) (Syntax: 'New With {.a = {{tr}}}') Initializers(1): ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.TypedReference(,), IsInvalid) (Syntax: '.a = {{tr}}') @@ -190,7 +194,8 @@ Module ModuleA End Module]]>.Value Dim expectedOperationTree = , IsInvalid) (Syntax: 'New With {. ... c, .c = .b}') Initializers(2): ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: ?, IsInvalid) (Syntax: '.b = .c') @@ -224,7 +229,8 @@ Module ModuleA End Module]]>.Value Dim expectedOperationTree = , IsInvalid) (Syntax: 'New With {. ... .c, .c = 1}') Initializers(2): ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: ?, IsInvalid) (Syntax: '.b = .c') @@ -482,7 +488,8 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Object, Constant: null) (Syntax: '.a = Nothing') Left: IPropertyReferenceExpression: Property .a As System.Object (Static) (OperationKind.PropertyReferenceExpression, Type: System.Object) (Syntax: 'a') Instance Receiver: null - Right: IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'Nothing') + Right: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object, Constant: null) (Syntax: 'Nothing') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILiteralExpression (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'Nothing') ]]>.Value @@ -818,7 +825,8 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress Left: IPropertyReferenceExpression: ReadOnly Property .a As System.String (Static) (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'a') Instance Receiver: null Right: IInvocationExpression (virtual Function System.Func(Of System.String).Invoke() As System.String) (OperationKind.InvocationExpression, Type: System.String, IsInvalid) (Syntax: 'DirectCast( ... )).Invoke()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Instance Receiver: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.String) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Function() ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Function() ... nd Function') Locals: Local_1: As System.String @@ -865,12 +873,14 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress Left: IPropertyReferenceExpression: ReadOnly Property .a As System.String (Static) (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'a') Instance Receiver: null Right: IInvocationExpression (virtual Function System.Func(Of System.String).Invoke() As System.String) (OperationKind.InvocationExpression, Type: System.String, IsInvalid) (Syntax: 'DirectCast( ... )).Invoke()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Instance Receiver: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.String) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Function() ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Function() ... nd Function') Locals: Local_1: As System.String IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'Return .a.ToString()') - ReturnedValue: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: '.a.ToString()') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: '.a.ToString()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.a.ToString()') Children(1): IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.a.ToString') @@ -917,12 +927,14 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress Left: IPropertyReferenceExpression: ReadOnly Property .a As System.String (Static) (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'a') Instance Receiver: null Right: IInvocationExpression (virtual Function System.Func(Of System.String).Invoke() As System.String) (OperationKind.InvocationExpression, Type: System.String, IsInvalid) (Syntax: 'DirectCast( ... )).Invoke()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Instance Receiver: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.String) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Function() ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Function() ... nd Function') Locals: Local_1: As System.String IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'Return .x.ToString()') - ReturnedValue: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: '.x.ToString()') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: '.x.ToString()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.x.ToString()') Children(1): IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.x.ToString') @@ -971,18 +983,21 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress Left: IPropertyReferenceExpression: ReadOnly Property .a As System.String (Static) (OperationKind.PropertyReferenceExpression, Type: System.String) (Syntax: 'a') Instance Receiver: null Right: IInvocationExpression (virtual Function System.Func(Of System.String).Invoke() As System.String) (OperationKind.InvocationExpression, Type: System.String, IsInvalid) (Syntax: 'DirectCast( ... )).Invoke()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Instance Receiver: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.String) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Function() ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Function() ... nd Function') Locals: Local_1: As System.String IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'Return Dire ... )).Invoke()') ReturnedValue: IInvocationExpression (virtual Function System.Func(Of System.String).Invoke() As System.String) (OperationKind.InvocationExpression, Type: System.String, IsInvalid) (Syntax: 'DirectCast( ... )).Invoke()') - Instance Receiver: IConversionExpression (ConversionKind.Cast, Explicit) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Instance Receiver: IConversionExpression (Explicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Func(Of System.String), IsInvalid) (Syntax: 'DirectCast( ... Of String))') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.String) (OperationKind.LambdaExpression, Type: null, IsInvalid) (Syntax: 'Function() ... nd Function') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement, IsInvalid) (Syntax: 'Function() ... nd Function') Locals: Local_1: As System.String IReturnStatement (OperationKind.ReturnStatement, IsInvalid) (Syntax: 'Return .x.ToString()') - ReturnedValue: IConversionExpression (ConversionKind.Invalid, Implicit) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: '.x.ToString()') + ReturnedValue: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.String, IsInvalid) (Syntax: '.x.ToString()') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.x.ToString()') Children(1): IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '.x.ToString') @@ -1084,7 +1099,8 @@ Module S1 End Module]]>.Value Dim expectedOperationTree = ) (Syntax: 'New With {x2}') Initializers(1): ILocalReferenceExpression: x2 (OperationKind.LocalReferenceExpression, Type: T) (Syntax: 'x2') diff --git a/src/Compilers/VisualBasic/Test/Semantic/Semantics/SelectCaseTests.vb b/src/Compilers/VisualBasic/Test/Semantic/Semantics/SelectCaseTests.vb index 6d263c5840319177b20480430a9795e9a3506a2f..82ae4eda503e852b8816a5b480a1d036632504c1 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/Semantics/SelectCaseTests.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/Semantics/SelectCaseTests.vb @@ -581,14 +581,17 @@ End Module]]>.Value Dim expectedOperationTree = () As System.Int32) (Syntax: 'Function() 5') + Value: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'Function() 5') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) + Operand: IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: Function () As System.Int32) (Syntax: 'Function() 5') + Conversion: CommonConversion (Exists: False, IsIdentity: False, IsNumeric: False, IsReference: False, IsUserDefined: False) (MethodSymbol: null) Operand: ILambdaExpression (Signature: Function () As System.Int32) (OperationKind.LambdaExpression, Type: null) (Syntax: 'Function() 5') IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement) (Syntax: 'Function() 5') Locals: Local_1: As System.Int32 @@ -639,7 +642,7 @@ Class C Dim day2 = day Select Case day 'BIND:"day" Case DayOfWeek.A - Case + Case End Select End Sub Enum DayOfWeek