Diagnostic("GeneratedCodeAnalyzerSummary").WithArguments("Node: var hiddenVar = 0,Node: var mixMethodHiddenVar = 0,Node: var mixMethodUserVar = 0,Node: var userVar = 0,Operation: HiddenMethod,Operation: MixMethod,Operation: NonHiddenMethod").WithLocation(1,1));
Diagnostic("GeneratedCodeAnalyzerSummary").WithArguments("Node: var hiddenVar = 0,Node: var mixMethodHiddenVar = 0,Node: var mixMethodUserVar = 0,Node: var userVar = 0,Operation: HiddenMethod,Operation: MixMethod,Operation: NonHiddenMethod").WithLocation(1,1));
// 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.
// 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.
// 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.
usingMicrosoft.CodeAnalysis.CSharp.Syntax;
...
...
@@ -30,7 +30,10 @@ public void M2(out int i )
}
";
stringexpectedOperationTree=@"
ILocalReferenceExpression: i (IsDeclaration: True) (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'var i')
Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x')
Sections:
ISwitchCase (1 case clauses, 1 statements) (OperationKind.SwitchCase) (Syntax: 'case var y ... break;')
Clauses:
IPatternCaseClause (Label Symbol: case var y when (x >= 10):) (CaseKind.Pattern) (OperationKind.PatternCaseClause) (Syntax: 'case var y ... (x >= 10):')
ISwitchCase (1 case clauses, 1 statements) (OperationKind.SwitchCase) (Syntax: 'case var y ... break;')
Clauses:
IPatternCaseClause (Label Symbol: case var y when (x >= 10):) (CaseKind.Pattern) (OperationKind.PatternCaseClause) (Syntax: 'case var y ... (x >= 10):')
Switch expression: IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x')
Sections:
ISwitchCase (1 case clauses, 1 statements) (OperationKind.SwitchCase) (Syntax: 'case var y ... break;')
Clauses:
IPatternCaseClause (Label Symbol: case var y when (x >= 10):) (CaseKind.Pattern) (OperationKind.PatternCaseClause) (Syntax: 'case var y ... (x >= 10):')
// 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.
// CS1061: 'Program' does not contain a definition for 'MissingField' and no extension method 'MissingField' accepting a first argument of type 'Program' could be found (are you missing a using directive or an assembly reference?)
Right: IBinaryOperatorExpression (BinaryOperatorKind.Remainder) (OperatorMethod: S S.op_Modulus(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'c * d / e % f')
Left: IBinaryOperatorExpression (BinaryOperatorKind.Divide) (OperatorMethod: S S.op_Division(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'c * d / e')
Left: IBinaryOperatorExpression (BinaryOperatorKind.Multiply) (OperatorMethod: S S.op_Multiply(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'c * d')
Left: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'c')
Right: ILocalReferenceExpression: d (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'd')
Right: ILocalReferenceExpression: e (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'e')
Right: ILocalReferenceExpression: f (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'f')
Right: ILocalReferenceExpression: g (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'g')
Right: IBinaryOperatorExpression (BinaryOperatorKind.ExclusiveOr) (OperatorMethod: S S.op_ExclusiveOr(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'h ^ i == j ... m <= o >= p')
Left: ILocalReferenceExpression: h (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'h')
Right: IBinaryOperatorExpression (BinaryOperatorKind.NotEquals) (OperatorMethod: S S.op_Inequality(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'i == j != k ... m <= o >= p')
Left: IBinaryOperatorExpression (BinaryOperatorKind.Equals) (OperatorMethod: S S.op_Equality(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'i == j')
Left: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'i')
Right: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThanOrEqual) (OperatorMethod: S S.op_GreaterThanOrEqual(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'k < l > m <= o >= p')
Left: IBinaryOperatorExpression (BinaryOperatorKind.LessThanOrEqual) (OperatorMethod: S S.op_LessThanOrEqual(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'k < l > m <= o')
Left: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan) (OperatorMethod: S S.op_GreaterThan(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'k < l > m')
Left: IBinaryOperatorExpression (BinaryOperatorKind.LessThan) (OperatorMethod: S S.op_LessThan(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'k < l')
Left: ILocalReferenceExpression: k (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'k')
Right: ILocalReferenceExpression: l (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'l')
Right: ILocalReferenceExpression: m (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'm')
Right: ILocalReferenceExpression: o (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'o')
Right: ILocalReferenceExpression: p (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'p')
IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '(a >> 10) + ... m <= o >= p')
IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '(a >> 10) + ... m <= o >= p')
Right: IBinaryOperatorExpression (BinaryOperatorKind.Remainder) (OperatorMethod: S S.op_Modulus(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'c * d / e % f')
Left: IBinaryOperatorExpression (BinaryOperatorKind.Divide) (OperatorMethod: S S.op_Division(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'c * d / e')
Left: IBinaryOperatorExpression (BinaryOperatorKind.Multiply) (OperatorMethod: S S.op_Multiply(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'c * d')
Left: ILocalReferenceExpression: c (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'c')
Right: ILocalReferenceExpression: d (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'd')
Right: ILocalReferenceExpression: e (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'e')
Right: ILocalReferenceExpression: f (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'f')
Right: ILocalReferenceExpression: g (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'g')
Right: IBinaryOperatorExpression (BinaryOperatorKind.ExclusiveOr) (OperatorMethod: S S.op_ExclusiveOr(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'h ^ i == j ... m <= o >= p')
Left: ILocalReferenceExpression: h (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'h')
Right: IBinaryOperatorExpression (BinaryOperatorKind.NotEquals) (OperatorMethod: S S.op_Inequality(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'i == j != k ... m <= o >= p')
Left: IBinaryOperatorExpression (BinaryOperatorKind.Equals) (OperatorMethod: S S.op_Equality(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'i == j')
Left: ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'i')
Right: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThanOrEqual) (OperatorMethod: S S.op_GreaterThanOrEqual(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'k < l > m <= o >= p')
Left: IBinaryOperatorExpression (BinaryOperatorKind.LessThanOrEqual) (OperatorMethod: S S.op_LessThanOrEqual(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'k < l > m <= o')
Left: IBinaryOperatorExpression (BinaryOperatorKind.GreaterThan) (OperatorMethod: S S.op_GreaterThan(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'k < l > m')
Left: IBinaryOperatorExpression (BinaryOperatorKind.LessThan) (OperatorMethod: S S.op_LessThan(S x, S y)) (OperationKind.BinaryOperatorExpression, Type: S) (Syntax: 'k < l')
Left: ILocalReferenceExpression: k (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'k')
Right: ILocalReferenceExpression: l (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'l')
Right: ILocalReferenceExpression: m (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'm')
Right: ILocalReferenceExpression: o (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'o')
Right: ILocalReferenceExpression: p (OperationKind.LocalReferenceExpression, Type: S) (Syntax: 'p')