751 references to UnaryOperatorKind
Microsoft.CodeAnalysis.CSharp (699)
Binder\Binder.ValueChecks.cs (8)
4628var prefix = increment.OperatorKind.Operator() is UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PrefixDecrement; 4629Debug.Assert(prefix || increment.OperatorKind.Operator() is UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement); 5370var prefix = increment.OperatorKind.Operator() is UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PrefixDecrement; 5371Debug.Assert(prefix || increment.OperatorKind.Operator() is UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement);
Binder\Binder_Operators.cs (85)
1652UnaryOperatorAnalysisResult result = operatorOverloadResolution(left.Syntax, operandPlaceholder, isNegative ? UnaryOperatorKind.False : UnaryOperatorKind.True, diagnostics); 1666UnaryOperatorAnalysisResult operatorOverloadResolution(SyntaxNode node, BoundExpression operand, UnaryOperatorKind kind, BindingDiagnosticBag diagnostics) 1800UnaryOperatorAnalysisResult? bestTrue = nonExtensionUnaryOperatorOverloadResolution(syntax, t, result, UnaryOperatorKind.True, leftPlaceholder, ref useSiteInfo); 1806bestFalse = nonExtensionUnaryOperatorOverloadResolution(syntax, t, result, UnaryOperatorKind.False, leftPlaceholder, ref useSiteInfo); 1902UnaryOperatorKind kind, 1960UnaryOperatorAnalysisResult? bestTrue = extensionUnaryOperatorOverloadResolution(syntax, extensionCandidates, result, extensionContainingType, UnaryOperatorKind.True, leftPlaceholder, ref useSiteInfo); 1966bestFalse = extensionUnaryOperatorOverloadResolution(syntax, extensionCandidates, result, extensionContainingType, UnaryOperatorKind.False, leftPlaceholder, ref useSiteInfo); 1993UnaryOperatorKind kind, 2262UnaryOperatorKind kind, 2301UnaryOperatorKind kind, 2333UnaryOperatorKind kind, 2368if (kind == UnaryOperatorKind.UnaryMinus && 2408UnaryOperatorKind kind, 3261UnaryOperatorKind kind = SyntaxKindToUnaryOperatorKind(node.Kind()); 3290kind.WithType(UnaryOperatorKind.Dynamic).WithOverflowChecksIfApplicable(CheckOverflowAtRuntime), 3431UnaryOperatorKind kind, 3440Debug.Assert(kind is (UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PrefixDecrement or UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement)); 3445if (kind is not (UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PrefixDecrement or UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement) || 3454if ((kind is (UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement) && resultIsUsed) || 3461(kind is UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PostfixIncrement ? 3465ordinaryName = kind is UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PostfixIncrement ? 3475UnaryOperatorKind kind, 3515UnaryOperatorKind kind, 3603(kind | UnaryOperatorKind.UserDefined).WithOverflowChecksIfApplicable(checkOverflowAtRuntime), 3628(kind | UnaryOperatorKind.UserDefined).WithOverflowChecksIfApplicable(checkOverflowAtRuntime), 3664UnaryOperatorKind kind, 3750UnaryOperatorKind kind, 4324UnaryOperatorKind kind = SyntaxKindToUnaryOperatorKind(node.Kind()); 4357operatorKind: kind.WithType(UnaryOperatorKind.Dynamic).WithOverflowChecksIfApplicable(CheckOverflowAtRuntime), 4394UnaryOperatorKind resultOperatorKind = signature.Kind; 4413UnaryOperatorKind kind, 4430UnaryOperatorKind newKind = kind.Operator().WithType(upconvertSpecialType); 4438var binder = kind.Operator() == UnaryOperatorKind.BitwiseComplement ? 4448UnaryOperatorKind kind, 4523private static object? FoldNeverOverflowUnaryOperator(UnaryOperatorKind kind, ConstantValue value) 4528case UnaryOperatorKind.DecimalUnaryMinus: 4530case UnaryOperatorKind.DoubleUnaryMinus: 4531case UnaryOperatorKind.FloatUnaryMinus: 4533case UnaryOperatorKind.DecimalUnaryPlus: 4535case UnaryOperatorKind.FloatUnaryPlus: 4536case UnaryOperatorKind.DoubleUnaryPlus: 4538case UnaryOperatorKind.LongUnaryPlus: 4540case UnaryOperatorKind.ULongUnaryPlus: 4542case UnaryOperatorKind.IntUnaryPlus: 4543case UnaryOperatorKind.NIntUnaryPlus: 4545case UnaryOperatorKind.UIntUnaryPlus: 4546case UnaryOperatorKind.NUIntUnaryPlus: 4548case UnaryOperatorKind.BoolLogicalNegation: 4550case UnaryOperatorKind.IntBitwiseComplement: 4552case UnaryOperatorKind.LongBitwiseComplement: 4554case UnaryOperatorKind.UIntBitwiseComplement: 4556case UnaryOperatorKind.ULongBitwiseComplement: 4563private static object? FoldUncheckedIntegralUnaryOperator(UnaryOperatorKind kind, ConstantValue value) 4569case UnaryOperatorKind.LongUnaryMinus: 4571case UnaryOperatorKind.IntUnaryMinus: 4579private static object? FoldCheckedIntegralUnaryOperator(UnaryOperatorKind kind, ConstantValue value) 4585case UnaryOperatorKind.LongUnaryMinus: 4587case UnaryOperatorKind.IntUnaryMinus: 4595private static object? FoldNativeIntegerOverflowingUnaryOperator(UnaryOperatorKind kind, ConstantValue value) 4601case UnaryOperatorKind.NIntUnaryMinus: 4603case UnaryOperatorKind.NIntBitwiseComplement: 4604case UnaryOperatorKind.NUIntBitwiseComplement: 4612public static UnaryOperatorKind SyntaxKindToUnaryOperatorKind(SyntaxKind kind) 4616case SyntaxKind.PreIncrementExpression: return UnaryOperatorKind.PrefixIncrement; 4617case SyntaxKind.PostIncrementExpression: return UnaryOperatorKind.PostfixIncrement; 4618case SyntaxKind.PreDecrementExpression: return UnaryOperatorKind.PrefixDecrement; 4619case SyntaxKind.PostDecrementExpression: return UnaryOperatorKind.PostfixDecrement; 4620case SyntaxKind.UnaryPlusExpression: return UnaryOperatorKind.UnaryPlus; 4621case SyntaxKind.UnaryMinusExpression: return UnaryOperatorKind.UnaryMinus; 4622case SyntaxKind.LogicalNotExpression: return UnaryOperatorKind.LogicalNegation; 4623case SyntaxKind.BitwiseNotExpression: return UnaryOperatorKind.BitwiseComplement; 6050private void CheckNativeIntegerFeatureAvailability(UnaryOperatorKind operatorKind, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 6057switch (operatorKind & UnaryOperatorKind.TypeMask) 6059case UnaryOperatorKind.NInt: 6060case UnaryOperatorKind.NUInt:
Binder\Binder_Statements.cs (2)
2703UnaryOperatorKind.DynamicTrue, 2754var best = this.UnaryOperatorOverloadResolution(UnaryOperatorKind.True, expr, node, diagnostics, ref discardedOperatorResolutionForReporting, out LookupResultKind resultKind, out ImmutableArray<MethodSymbol> originalUserDefinedOperators);
Binder\Binder_TupleOperators.cs (3)
146UnaryOperatorKind boolOpKind; 150boolOpKind = UnaryOperatorKind.False; 153boolOpKind = UnaryOperatorKind.True;
Binder\Semantics\Operators\OperatorFacts.cs (13)
231public static string UnaryOperatorNameFromOperatorKind(UnaryOperatorKind kind, bool isChecked) 233switch (kind & UnaryOperatorKind.OpMask) 235case UnaryOperatorKind.UnaryPlus: return WellKnownMemberNames.UnaryPlusOperatorName; 236case UnaryOperatorKind.UnaryMinus: return isChecked ? WellKnownMemberNames.CheckedUnaryNegationOperatorName : WellKnownMemberNames.UnaryNegationOperatorName; 237case UnaryOperatorKind.BitwiseComplement: return WellKnownMemberNames.OnesComplementOperatorName; 238case UnaryOperatorKind.LogicalNegation: return WellKnownMemberNames.LogicalNotOperatorName; 239case UnaryOperatorKind.PostfixIncrement: 240case UnaryOperatorKind.PrefixIncrement: return isChecked ? WellKnownMemberNames.CheckedIncrementOperatorName : WellKnownMemberNames.IncrementOperatorName; 241case UnaryOperatorKind.PostfixDecrement: 242case UnaryOperatorKind.PrefixDecrement: return isChecked ? WellKnownMemberNames.CheckedDecrementOperatorName : WellKnownMemberNames.DecrementOperatorName; 243case UnaryOperatorKind.True: return WellKnownMemberNames.TrueOperatorName; 244case UnaryOperatorKind.False: return WellKnownMemberNames.FalseOperatorName; 246throw ExceptionUtilities.UnexpectedValue(kind & UnaryOperatorKind.OpMask);
Binder\Semantics\Operators\OperatorKind.cs (36)
294TypeMask = UnaryOperatorKind.TypeMask, 296Int = UnaryOperatorKind.Int, 297UInt = UnaryOperatorKind.UInt, 298Long = UnaryOperatorKind.Long, 299ULong = UnaryOperatorKind.ULong, 300NInt = UnaryOperatorKind.NInt, 301NUInt = UnaryOperatorKind.NUInt, 302Char = UnaryOperatorKind.Char, //not used 303Float = UnaryOperatorKind.Float, 304Double = UnaryOperatorKind.Double, 305Decimal = UnaryOperatorKind.Decimal, 306Bool = UnaryOperatorKind.Bool, 307Object = UnaryOperatorKind._Object, 308String = UnaryOperatorKind._String, 309StringAndObject = UnaryOperatorKind._StringAndObject, 310ObjectAndString = UnaryOperatorKind._ObjectAndString, 312Enum = UnaryOperatorKind.Enum, 313EnumAndUnderlying = UnaryOperatorKind._EnumAndUnderlying, 314UnderlyingAndEnum = UnaryOperatorKind._UnderlyingAndEnum, 315Delegate = UnaryOperatorKind._Delegate, 316Pointer = UnaryOperatorKind.Pointer, 317PointerAndInt = UnaryOperatorKind._PointerAndInt, 318PointerAndUInt = UnaryOperatorKind._PointerAndUInt, 319PointerAndLong = UnaryOperatorKind._PointerAndLong, 320PointerAndULong = UnaryOperatorKind._PointerAndULong, 321IntAndPointer = UnaryOperatorKind._IntAndPointer, 322UIntAndPointer = UnaryOperatorKind._UIntAndPointer, 323LongAndPointer = UnaryOperatorKind._LongAndPointer, 324ULongAndPointer = UnaryOperatorKind._ULongAndPointer, 325NullableNull = UnaryOperatorKind._NullableNull, 326UserDefined = UnaryOperatorKind.UserDefined, 327Dynamic = UnaryOperatorKind.Dynamic, 328Utf8 = UnaryOperatorKind._Utf8, 349Lifted = UnaryOperatorKind.Lifted, 350Logical = UnaryOperatorKind._Logical, 351Checked = UnaryOperatorKind.Checked,
Binder\Semantics\Operators\OperatorKindExtensions.cs (78)
19public static int OperatorIndex(this UnaryOperatorKind kind) 24public static UnaryOperatorKind Operator(this UnaryOperatorKind kind) 26return kind & UnaryOperatorKind.OpMask; 29public static UnaryOperatorKind Unlifted(this UnaryOperatorKind kind) 31return kind & ~UnaryOperatorKind.Lifted; 34public static bool IsLifted(this UnaryOperatorKind kind) 36return 0 != (kind & UnaryOperatorKind.Lifted); 39public static bool IsChecked(this UnaryOperatorKind kind) 41return 0 != (kind & UnaryOperatorKind.Checked); 44public static bool IsUserDefined(this UnaryOperatorKind kind) 46return (kind & UnaryOperatorKind.TypeMask) == UnaryOperatorKind.UserDefined; 49public static UnaryOperatorKind OverflowChecks(this UnaryOperatorKind kind) 51return kind & UnaryOperatorKind.Checked; 54public static UnaryOperatorKind WithOverflowChecksIfApplicable(this UnaryOperatorKind kind, bool enabled) 64return kind | UnaryOperatorKind.Checked; 71case UnaryOperatorKind.PrefixIncrement: 72case UnaryOperatorKind.PostfixIncrement: 73case UnaryOperatorKind.PrefixDecrement: 74case UnaryOperatorKind.PostfixDecrement: 75case UnaryOperatorKind.UnaryMinus: 76return kind | UnaryOperatorKind.Checked; 83return kind & ~UnaryOperatorKind.Checked; 87public static UnaryOperatorKind OperandTypes(this UnaryOperatorKind kind) 89return kind & UnaryOperatorKind.TypeMask; 92public static bool IsDynamic(this UnaryOperatorKind kind) 94return kind.OperandTypes() == UnaryOperatorKind.Dynamic; 97public static bool IsIntegral(this UnaryOperatorKind kind) 101case UnaryOperatorKind.SByte: 102case UnaryOperatorKind.Byte: 103case UnaryOperatorKind.Short: 104case UnaryOperatorKind.UShort: 105case UnaryOperatorKind.Int: 106case UnaryOperatorKind.UInt: 107case UnaryOperatorKind.Long: 108case UnaryOperatorKind.ULong: 109case UnaryOperatorKind.NInt: 110case UnaryOperatorKind.NUInt: 111case UnaryOperatorKind.Char: 112case UnaryOperatorKind.Enum: 113case UnaryOperatorKind.Pointer: 120public static UnaryOperatorKind WithType(this UnaryOperatorKind kind, UnaryOperatorKind type) 122Debug.Assert(kind == (kind & ~UnaryOperatorKind.TypeMask)); 123Debug.Assert(type == (type & UnaryOperatorKind.TypeMask)); 165public static UnaryOperatorKind WithType(this UnaryOperatorKind kind, SpecialType type) 167Debug.Assert(kind == (kind & ~UnaryOperatorKind.TypeMask)); 171return kind | UnaryOperatorKind.Int; 173return kind | UnaryOperatorKind.UInt; 175return kind | UnaryOperatorKind.Long; 177return kind | UnaryOperatorKind.ULong; 281public static bool IsEnum(this UnaryOperatorKind kind) 283return kind.OperandTypes() == UnaryOperatorKind.Enum; 380public static ExpressionType ToExpressionType(this UnaryOperatorKind kind) 384case UnaryOperatorKind.PrefixIncrement: 385case UnaryOperatorKind.PostfixIncrement: 388case UnaryOperatorKind.PostfixDecrement: 389case UnaryOperatorKind.PrefixDecrement: 392case UnaryOperatorKind.UnaryPlus: return ExpressionType.UnaryPlus; 393case UnaryOperatorKind.UnaryMinus: return ExpressionType.Negate; 394case UnaryOperatorKind.LogicalNegation: return ExpressionType.Not; 395case UnaryOperatorKind.BitwiseComplement: return ExpressionType.OnesComplement; 396case UnaryOperatorKind.True: return ExpressionType.IsTrue; 397case UnaryOperatorKind.False: return ExpressionType.IsFalse; 417public static string Dump(this UnaryOperatorKind kind) 420if ((kind & UnaryOperatorKind.Lifted) != 0) b.Append("Lifted"); 421if ((kind & UnaryOperatorKind.Checked) != 0) b.Append("Checked"); 422var type = kind & UnaryOperatorKind.TypeMask; 424var op = kind & UnaryOperatorKind.OpMask;
Binder\Semantics\Operators\UnaryOperatorEasyOut.cs (92)
14private const UnaryOperatorKind ERR = UnaryOperatorKind.Error; 16private const UnaryOperatorKind BOL = UnaryOperatorKind.Bool; 17private const UnaryOperatorKind CHR = UnaryOperatorKind.Char; 18private const UnaryOperatorKind I08 = UnaryOperatorKind.SByte; 19private const UnaryOperatorKind U08 = UnaryOperatorKind.Byte; 20private const UnaryOperatorKind I16 = UnaryOperatorKind.Short; 21private const UnaryOperatorKind U16 = UnaryOperatorKind.UShort; 22private const UnaryOperatorKind I32 = UnaryOperatorKind.Int; 23private const UnaryOperatorKind U32 = UnaryOperatorKind.UInt; 24private const UnaryOperatorKind I64 = UnaryOperatorKind.Long; 25private const UnaryOperatorKind U64 = UnaryOperatorKind.ULong; 26private const UnaryOperatorKind NIN = UnaryOperatorKind.NInt; 27private const UnaryOperatorKind NUI = UnaryOperatorKind.NUInt; 28private const UnaryOperatorKind R32 = UnaryOperatorKind.Float; 29private const UnaryOperatorKind R64 = UnaryOperatorKind.Double; 30private const UnaryOperatorKind DEC = UnaryOperatorKind.Decimal; 31private const UnaryOperatorKind LBOL = UnaryOperatorKind.Lifted | UnaryOperatorKind.Bool; 32private const UnaryOperatorKind LCHR = UnaryOperatorKind.Lifted | UnaryOperatorKind.Char; 33private const UnaryOperatorKind LI08 = UnaryOperatorKind.Lifted | UnaryOperatorKind.SByte; 34private const UnaryOperatorKind LU08 = UnaryOperatorKind.Lifted | UnaryOperatorKind.Byte; 35private const UnaryOperatorKind LI16 = UnaryOperatorKind.Lifted | UnaryOperatorKind.Short; 36private const UnaryOperatorKind LU16 = UnaryOperatorKind.Lifted | UnaryOperatorKind.UShort; 37private const UnaryOperatorKind LI32 = UnaryOperatorKind.Lifted | UnaryOperatorKind.Int; 38private const UnaryOperatorKind LU32 = UnaryOperatorKind.Lifted | UnaryOperatorKind.UInt; 39private const UnaryOperatorKind LI64 = UnaryOperatorKind.Lifted | UnaryOperatorKind.Long; 40private const UnaryOperatorKind LU64 = UnaryOperatorKind.Lifted | UnaryOperatorKind.ULong; 41private const UnaryOperatorKind LNI = UnaryOperatorKind.Lifted | UnaryOperatorKind.NInt; 42private const UnaryOperatorKind LNU = UnaryOperatorKind.Lifted | UnaryOperatorKind.NUInt; 43private const UnaryOperatorKind LR32 = UnaryOperatorKind.Lifted | UnaryOperatorKind.Float; 44private const UnaryOperatorKind LR64 = UnaryOperatorKind.Lifted | UnaryOperatorKind.Double; 45private const UnaryOperatorKind LDEC = UnaryOperatorKind.Lifted | UnaryOperatorKind.Decimal; 47private static readonly UnaryOperatorKind[] s_increment = 52private static readonly UnaryOperatorKind[] s_plus = 57private static readonly UnaryOperatorKind[] s_minus = 62private static readonly UnaryOperatorKind[] s_logicalNegation = 67private static readonly UnaryOperatorKind[] s_bitwiseComplement = 72private static readonly UnaryOperatorKind[][] s_opkind = 84public static UnaryOperatorKind OpKind(UnaryOperatorKind kind, TypeSymbol operand) 89return UnaryOperatorKind.Error; 92var result = (kindIndex >= s_opkind.Length) ? UnaryOperatorKind.Error : s_opkind[kindIndex][index]; 93return result == UnaryOperatorKind.Error ? result : result | kind; 97private void UnaryOperatorEasyOut(UnaryOperatorKind kind, BoundExpression operand, UnaryOperatorOverloadResolutionResult result) 105var easyOut = UnopEasyOut.OpKind(kind, operandType); 107if (easyOut == UnaryOperatorKind.Error)
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (42)
25UnaryOperatorKind kind, 74UnaryOperatorKind kind, 113static void getDeclaredUserDefinedUnaryOperatorsInScope(ArrayBuilder<Symbol> extensionCandidatesInSingleScope, UnaryOperatorKind kind, string name1, string? name2Opt, ArrayBuilder<UnaryOperatorSignature> operators) 144static void getDeclaredUserDefinedUnaryOperators(ArrayBuilder<Symbol> extensionCandidatesInSingleScope, UnaryOperatorKind kind, string name, ArrayBuilder<UnaryOperatorSignature> operators) 153void inferTypeArgumentsAndRemoveInapplicableToReceiverType(UnaryOperatorKind kind, BoundExpression operand, ArrayBuilder<UnaryOperatorSignature> operators, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 196inferredCandidate = new UnaryOperatorSignature(UnaryOperatorKind.Lifted | UnaryOperatorKind.UserDefined | kind, MakeNullable(operandType), MakeNullable(resultType), method, constrainedToTypeOpt: null); 200inferredCandidate = new UnaryOperatorSignature(UnaryOperatorKind.UserDefined | kind, operandType, resultType, method, constrainedToTypeOpt: null); 498private void GetAllBuiltInOperators(UnaryOperatorKind kind, bool isChecked, BoundExpression operand, ArrayBuilder<UnaryOperatorAnalysisResult> results, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 549private void GetEnumOperations(UnaryOperatorKind kind, BoundExpression operand, ArrayBuilder<UnaryOperatorSignature> operators) 569case UnaryOperatorKind.PostfixIncrement: 570case UnaryOperatorKind.PostfixDecrement: 571case UnaryOperatorKind.PrefixIncrement: 572case UnaryOperatorKind.PrefixDecrement: 573case UnaryOperatorKind.BitwiseComplement: 574operators.Add(new UnaryOperatorSignature(kind | UnaryOperatorKind.Enum, enumType, enumType)); 575operators.Add(new UnaryOperatorSignature(kind | UnaryOperatorKind.Lifted | UnaryOperatorKind.Enum, nullableEnum, nullableEnum)); 580private static UnaryOperatorSignature? GetPointerOperation(UnaryOperatorKind kind, BoundExpression operand) 593case UnaryOperatorKind.PostfixIncrement: 594case UnaryOperatorKind.PostfixDecrement: 595case UnaryOperatorKind.PrefixIncrement: 596case UnaryOperatorKind.PrefixDecrement: 597op = new UnaryOperatorSignature(kind | UnaryOperatorKind.Pointer, pointerType, pointerType); 605UnaryOperatorKind kind, 651UnaryOperatorKind kind, 753internal static void GetStaticUserDefinedUnaryOperatorMethodNames(UnaryOperatorKind kind, bool isChecked, out string name1, out string? name2Opt) 770UnaryOperatorKind kind, 809private static void GetDeclaredUserDefinedUnaryOperators(TypeSymbol? constrainedToTypeOpt, NamedTypeSymbol type, UnaryOperatorKind kind, string name, ArrayBuilder<UnaryOperatorSignature> operators) 817private static void GetDeclaredUserDefinedUnaryOperators(TypeSymbol? constrainedToTypeOpt, IEnumerable<MethodSymbol> typeOperators, UnaryOperatorKind kind, string name, ArrayBuilder<UnaryOperatorSignature> operators) 835operators.Add(new UnaryOperatorSignature(UnaryOperatorKind.UserDefined | kind, operandType, resultType, op, constrainedToTypeOpt)); 839private void AddLiftedUserDefinedUnaryOperators(TypeSymbol? constrainedToTypeOpt, UnaryOperatorKind kind, ArrayBuilder<UnaryOperatorSignature> operators) 847case UnaryOperatorKind.UnaryPlus: 848case UnaryOperatorKind.PrefixDecrement: 849case UnaryOperatorKind.PrefixIncrement: 850case UnaryOperatorKind.UnaryMinus: 851case UnaryOperatorKind.PostfixDecrement: 852case UnaryOperatorKind.PostfixIncrement: 853case UnaryOperatorKind.LogicalNegation: 854case UnaryOperatorKind.BitwiseComplement: 866UnaryOperatorKind.Lifted | UnaryOperatorKind.UserDefined | kind,
Binder\Semantics\Operators\UnaryOperatorSignature.cs (3)
21public readonly UnaryOperatorKind Kind; 23public UnaryOperatorSignature(UnaryOperatorKind kind, TypeSymbol operandType, TypeSymbol returnType) 32public UnaryOperatorSignature(UnaryOperatorKind kind, TypeSymbol operandType, TypeSymbol returnType, MethodSymbol method, TypeSymbol constrainedToTypeOpt)
BoundTree\Constructors.cs (4)
685UnaryOperatorKind operatorKind, 697public BoundUnaryOperator Update(UnaryOperatorKind operatorKind, 711UnaryOperatorKind operatorKind, 726public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, TypeSymbol type)
CodeGen\EmitOperators.cs (13)
19var operatorKind = expression.OperatorKind; 33if (operatorKind == UnaryOperatorKind.BoolLogicalNegation) 42case UnaryOperatorKind.UnaryMinus: 46case UnaryOperatorKind.BitwiseComplement: 50case UnaryOperatorKind.UnaryPlus: 575Debug.Assert(unOp.OperatorKind == UnaryOperatorKind.BoolLogicalNegation); 583Debug.Assert(expression.OperatorKind.Operator() == UnaryOperatorKind.UnaryMinus); 584var type = expression.OperatorKind.OperandTypes(); 596Debug.Assert(type == UnaryOperatorKind.Int || type == UnaryOperatorKind.Long || type == UnaryOperatorKind.NInt); 605if (type == UnaryOperatorKind.Long) 609else if (type == UnaryOperatorKind.NInt)
CodeGen\EmitStatement.cs (1)
577if (unOp.OperatorKind == UnaryOperatorKind.BoolLogicalNegation)
CodeGen\Optimizer.cs (1)
1666if (node.OperatorKind.IsChecked() && node.OperatorKind.Operator() == UnaryOperatorKind.UnaryMinus)
Compilation\BuiltInOperators.cs (176)
44builder.Add(GetSignature((UnaryOperatorKind)kind)); 50internal void GetSimpleBuiltInOperators(UnaryOperatorKind kind, ArrayBuilder<UnaryOperatorSignature> operators, bool skipNativeIntegerOperators) 58(int)UnaryOperatorKind.SBytePostfixIncrement, 59(int)UnaryOperatorKind.BytePostfixIncrement, 60(int)UnaryOperatorKind.ShortPostfixIncrement, 61(int)UnaryOperatorKind.UShortPostfixIncrement, 62(int)UnaryOperatorKind.IntPostfixIncrement, 63(int)UnaryOperatorKind.UIntPostfixIncrement, 64(int)UnaryOperatorKind.LongPostfixIncrement, 65(int)UnaryOperatorKind.ULongPostfixIncrement, 66(int)UnaryOperatorKind.NIntPostfixIncrement, 67(int)UnaryOperatorKind.NUIntPostfixIncrement, 68(int)UnaryOperatorKind.CharPostfixIncrement, 69(int)UnaryOperatorKind.FloatPostfixIncrement, 70(int)UnaryOperatorKind.DoublePostfixIncrement, 71(int)UnaryOperatorKind.DecimalPostfixIncrement, 72(int)UnaryOperatorKind.LiftedSBytePostfixIncrement, 73(int)UnaryOperatorKind.LiftedBytePostfixIncrement, 74(int)UnaryOperatorKind.LiftedShortPostfixIncrement, 75(int)UnaryOperatorKind.LiftedUShortPostfixIncrement, 76(int)UnaryOperatorKind.LiftedIntPostfixIncrement, 77(int)UnaryOperatorKind.LiftedUIntPostfixIncrement, 78(int)UnaryOperatorKind.LiftedLongPostfixIncrement, 79(int)UnaryOperatorKind.LiftedULongPostfixIncrement, 80(int)UnaryOperatorKind.LiftedNIntPostfixIncrement, 81(int)UnaryOperatorKind.LiftedNUIntPostfixIncrement, 82(int)UnaryOperatorKind.LiftedCharPostfixIncrement, 83(int)UnaryOperatorKind.LiftedFloatPostfixIncrement, 84(int)UnaryOperatorKind.LiftedDoublePostfixIncrement, 85(int)UnaryOperatorKind.LiftedDecimalPostfixIncrement, 89(int)UnaryOperatorKind.SBytePostfixDecrement, 90(int)UnaryOperatorKind.BytePostfixDecrement, 91(int)UnaryOperatorKind.ShortPostfixDecrement, 92(int)UnaryOperatorKind.UShortPostfixDecrement, 93(int)UnaryOperatorKind.IntPostfixDecrement, 94(int)UnaryOperatorKind.UIntPostfixDecrement, 95(int)UnaryOperatorKind.LongPostfixDecrement, 96(int)UnaryOperatorKind.ULongPostfixDecrement, 97(int)UnaryOperatorKind.NIntPostfixDecrement, 98(int)UnaryOperatorKind.NUIntPostfixDecrement, 99(int)UnaryOperatorKind.CharPostfixDecrement, 100(int)UnaryOperatorKind.FloatPostfixDecrement, 101(int)UnaryOperatorKind.DoublePostfixDecrement, 102(int)UnaryOperatorKind.DecimalPostfixDecrement, 103(int)UnaryOperatorKind.LiftedSBytePostfixDecrement, 104(int)UnaryOperatorKind.LiftedBytePostfixDecrement, 105(int)UnaryOperatorKind.LiftedShortPostfixDecrement, 106(int)UnaryOperatorKind.LiftedUShortPostfixDecrement, 107(int)UnaryOperatorKind.LiftedIntPostfixDecrement, 108(int)UnaryOperatorKind.LiftedUIntPostfixDecrement, 109(int)UnaryOperatorKind.LiftedLongPostfixDecrement, 110(int)UnaryOperatorKind.LiftedULongPostfixDecrement, 111(int)UnaryOperatorKind.LiftedNIntPostfixDecrement, 112(int)UnaryOperatorKind.LiftedNUIntPostfixDecrement, 113(int)UnaryOperatorKind.LiftedCharPostfixDecrement, 114(int)UnaryOperatorKind.LiftedFloatPostfixDecrement, 115(int)UnaryOperatorKind.LiftedDoublePostfixDecrement, 116(int)UnaryOperatorKind.LiftedDecimalPostfixDecrement, 120(int)UnaryOperatorKind.SBytePrefixIncrement, 121(int)UnaryOperatorKind.BytePrefixIncrement, 122(int)UnaryOperatorKind.ShortPrefixIncrement, 123(int)UnaryOperatorKind.UShortPrefixIncrement, 124(int)UnaryOperatorKind.IntPrefixIncrement, 125(int)UnaryOperatorKind.UIntPrefixIncrement, 126(int)UnaryOperatorKind.LongPrefixIncrement, 127(int)UnaryOperatorKind.ULongPrefixIncrement, 128(int)UnaryOperatorKind.NIntPrefixIncrement, 129(int)UnaryOperatorKind.NUIntPrefixIncrement, 130(int)UnaryOperatorKind.CharPrefixIncrement, 131(int)UnaryOperatorKind.FloatPrefixIncrement, 132(int)UnaryOperatorKind.DoublePrefixIncrement, 133(int)UnaryOperatorKind.DecimalPrefixIncrement, 134(int)UnaryOperatorKind.LiftedSBytePrefixIncrement, 135(int)UnaryOperatorKind.LiftedBytePrefixIncrement, 136(int)UnaryOperatorKind.LiftedShortPrefixIncrement, 137(int)UnaryOperatorKind.LiftedUShortPrefixIncrement, 138(int)UnaryOperatorKind.LiftedIntPrefixIncrement, 139(int)UnaryOperatorKind.LiftedUIntPrefixIncrement, 140(int)UnaryOperatorKind.LiftedLongPrefixIncrement, 141(int)UnaryOperatorKind.LiftedULongPrefixIncrement, 142(int)UnaryOperatorKind.LiftedNIntPrefixIncrement, 143(int)UnaryOperatorKind.LiftedNUIntPrefixIncrement, 144(int)UnaryOperatorKind.LiftedCharPrefixIncrement, 145(int)UnaryOperatorKind.LiftedFloatPrefixIncrement, 146(int)UnaryOperatorKind.LiftedDoublePrefixIncrement, 147(int)UnaryOperatorKind.LiftedDecimalPrefixIncrement, 151(int)UnaryOperatorKind.SBytePrefixDecrement, 152(int)UnaryOperatorKind.BytePrefixDecrement, 153(int)UnaryOperatorKind.ShortPrefixDecrement, 154(int)UnaryOperatorKind.UShortPrefixDecrement, 155(int)UnaryOperatorKind.IntPrefixDecrement, 156(int)UnaryOperatorKind.UIntPrefixDecrement, 157(int)UnaryOperatorKind.NIntPrefixDecrement, 158(int)UnaryOperatorKind.NUIntPrefixDecrement, 159(int)UnaryOperatorKind.LongPrefixDecrement, 160(int)UnaryOperatorKind.ULongPrefixDecrement, 161(int)UnaryOperatorKind.CharPrefixDecrement, 162(int)UnaryOperatorKind.FloatPrefixDecrement, 163(int)UnaryOperatorKind.DoublePrefixDecrement, 164(int)UnaryOperatorKind.DecimalPrefixDecrement, 165(int)UnaryOperatorKind.LiftedSBytePrefixDecrement, 166(int)UnaryOperatorKind.LiftedBytePrefixDecrement, 167(int)UnaryOperatorKind.LiftedShortPrefixDecrement, 168(int)UnaryOperatorKind.LiftedUShortPrefixDecrement, 169(int)UnaryOperatorKind.LiftedIntPrefixDecrement, 170(int)UnaryOperatorKind.LiftedUIntPrefixDecrement, 171(int)UnaryOperatorKind.LiftedLongPrefixDecrement, 172(int)UnaryOperatorKind.LiftedULongPrefixDecrement, 173(int)UnaryOperatorKind.LiftedNIntPrefixDecrement, 174(int)UnaryOperatorKind.LiftedNUIntPrefixDecrement, 175(int)UnaryOperatorKind.LiftedCharPrefixDecrement, 176(int)UnaryOperatorKind.LiftedFloatPrefixDecrement, 177(int)UnaryOperatorKind.LiftedDoublePrefixDecrement, 178(int)UnaryOperatorKind.LiftedDecimalPrefixDecrement, 182(int)UnaryOperatorKind.IntUnaryPlus, 183(int)UnaryOperatorKind.UIntUnaryPlus, 184(int)UnaryOperatorKind.LongUnaryPlus, 185(int)UnaryOperatorKind.ULongUnaryPlus, 186(int)UnaryOperatorKind.NIntUnaryPlus, 187(int)UnaryOperatorKind.NUIntUnaryPlus, 188(int)UnaryOperatorKind.FloatUnaryPlus, 189(int)UnaryOperatorKind.DoubleUnaryPlus, 190(int)UnaryOperatorKind.DecimalUnaryPlus, 191(int)UnaryOperatorKind.LiftedIntUnaryPlus, 192(int)UnaryOperatorKind.LiftedUIntUnaryPlus, 193(int)UnaryOperatorKind.LiftedLongUnaryPlus, 194(int)UnaryOperatorKind.LiftedULongUnaryPlus, 195(int)UnaryOperatorKind.LiftedNIntUnaryPlus, 196(int)UnaryOperatorKind.LiftedNUIntUnaryPlus, 197(int)UnaryOperatorKind.LiftedFloatUnaryPlus, 198(int)UnaryOperatorKind.LiftedDoubleUnaryPlus, 199(int)UnaryOperatorKind.LiftedDecimalUnaryPlus, 203(int)UnaryOperatorKind.IntUnaryMinus, 204(int)UnaryOperatorKind.LongUnaryMinus, 205(int)UnaryOperatorKind.NIntUnaryMinus, 206(int)UnaryOperatorKind.FloatUnaryMinus, 207(int)UnaryOperatorKind.DoubleUnaryMinus, 208(int)UnaryOperatorKind.DecimalUnaryMinus, 209(int)UnaryOperatorKind.LiftedIntUnaryMinus, 210(int)UnaryOperatorKind.LiftedLongUnaryMinus, 211(int)UnaryOperatorKind.LiftedNIntUnaryMinus, 212(int)UnaryOperatorKind.LiftedFloatUnaryMinus, 213(int)UnaryOperatorKind.LiftedDoubleUnaryMinus, 214(int)UnaryOperatorKind.LiftedDecimalUnaryMinus, 218(int)UnaryOperatorKind.BoolLogicalNegation, 219(int)UnaryOperatorKind.LiftedBoolLogicalNegation, 223(int)UnaryOperatorKind.IntBitwiseComplement, 224(int)UnaryOperatorKind.UIntBitwiseComplement, 225(int)UnaryOperatorKind.LongBitwiseComplement, 226(int)UnaryOperatorKind.ULongBitwiseComplement, 227(int)UnaryOperatorKind.NIntBitwiseComplement, 228(int)UnaryOperatorKind.NUIntBitwiseComplement, 229(int)UnaryOperatorKind.LiftedIntBitwiseComplement, 230(int)UnaryOperatorKind.LiftedUIntBitwiseComplement, 231(int)UnaryOperatorKind.LiftedLongBitwiseComplement, 232(int)UnaryOperatorKind.LiftedULongBitwiseComplement, 233(int)UnaryOperatorKind.LiftedNIntBitwiseComplement, 234(int)UnaryOperatorKind.LiftedNUIntBitwiseComplement, 250case UnaryOperatorKind.NInt: 251case UnaryOperatorKind.NUInt: 259internal UnaryOperatorSignature GetSignature(UnaryOperatorKind kind) 264case UnaryOperatorKind.SByte: opType = _compilation.GetSpecialType(SpecialType.System_SByte); break; 265case UnaryOperatorKind.Byte: opType = _compilation.GetSpecialType(SpecialType.System_Byte); break; 266case UnaryOperatorKind.Short: opType = _compilation.GetSpecialType(SpecialType.System_Int16); break; 267case UnaryOperatorKind.UShort: opType = _compilation.GetSpecialType(SpecialType.System_UInt16); break; 268case UnaryOperatorKind.Int: opType = _compilation.GetSpecialType(SpecialType.System_Int32); break; 269case UnaryOperatorKind.UInt: opType = _compilation.GetSpecialType(SpecialType.System_UInt32); break; 270case UnaryOperatorKind.Long: opType = _compilation.GetSpecialType(SpecialType.System_Int64); break; 271case UnaryOperatorKind.ULong: opType = _compilation.GetSpecialType(SpecialType.System_UInt64); break; 272case UnaryOperatorKind.NInt: opType = _compilation.CreateNativeIntegerTypeSymbol(signed: true); break; 273case UnaryOperatorKind.NUInt: opType = _compilation.CreateNativeIntegerTypeSymbol(signed: false); break; 274case UnaryOperatorKind.Char: opType = _compilation.GetSpecialType(SpecialType.System_Char); break; 275case UnaryOperatorKind.Float: opType = _compilation.GetSpecialType(SpecialType.System_Single); break; 276case UnaryOperatorKind.Double: opType = _compilation.GetSpecialType(SpecialType.System_Double); break; 277case UnaryOperatorKind.Decimal: opType = _compilation.GetSpecialType(SpecialType.System_Decimal); break; 278case UnaryOperatorKind.Bool: opType = _compilation.GetSpecialType(SpecialType.System_Boolean); break;
Compilation\CSharpCompilation.cs (8)
4604var unaryKind = Binder.SyntaxKindToUnaryOperatorKind(SyntaxFacts.GetPrefixUnaryExpression(syntaxKind)); 4609var easyOutUnaryKind = OverloadResolution.UnopEasyOut.OpKind(unaryKind, csharpOperandType); 4611if (easyOutUnaryKind != UnaryOperatorKind.Error) 4625unaryKind is UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PrefixDecrement or UnaryOperatorKind.BitwiseComplement && 4633unaryKind is UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PrefixDecrement &&
Compilation\CSharpSemanticModel.cs (6)
3800UnaryOperatorKind operandType = unaryOperator.OperatorKind.OperandTypes(); 3803if (operandType == 0 || operandType == UnaryOperatorKind.UserDefined || unaryOperator.ResultKind != LookupResultKind.Viable) 3813UnaryOperatorKind op = unaryOperator.OperatorKind.Operator(); 3823UnaryOperatorKind operandType = increment.OperatorKind.OperandTypes(); 3826if (operandType == 0 || operandType == UnaryOperatorKind.UserDefined || increment.ResultKind != LookupResultKind.Viable) 3836UnaryOperatorKind op = increment.OperatorKind.Operator();
FlowAnalysis\AbstractFlowPass.cs (1)
2787if (node.OperatorKind == UnaryOperatorKind.BoolLogicalNegation)
FlowAnalysis\NullableWalker.cs (6)
11243var op = node.OperatorKind.Operator(); 11244TypeWithState resultType = (op == UnaryOperatorKind.PrefixIncrement || op == UnaryOperatorKind.PrefixDecrement) ? resultOfIncrementType : operandType; 12082case UnaryOperatorKind.BoolLogicalNegation: 12088case UnaryOperatorKind.DynamicTrue: 12094case UnaryOperatorKind.DynamicLogicalNegation:
Generated\BoundNodes.xml.Generated.cs (6)
1177public BoundUnaryOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1194public UnaryOperatorKind OperatorKind { get; } 1205public BoundUnaryOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type) 1219public BoundIncrementOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1239public UnaryOperatorKind OperatorKind { get; } 1253public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (10)
1187var opKind = node.OperatorKind; 1188var op = opKind & UnaryOperatorKind.OpMask; 1189var isChecked = (opKind & UnaryOperatorKind.Checked) != 0; 1194case UnaryOperatorKind.UnaryPlus: 1201case UnaryOperatorKind.UnaryMinus: 1206case UnaryOperatorKind.BitwiseComplement: 1207case UnaryOperatorKind.LogicalNegation: 1235if (node.OperatorKind.OperandTypes() == UnaryOperatorKind.Enum && (opKind & UnaryOperatorKind.Lifted) != 0)
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (19)
343return MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, loweredRight, loweredRight.Type); 346return MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, loweredLeft, loweredLeft.Type); 357return MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, loweredRight, loweredRight.Type); 360return MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, loweredLeft, loweredLeft.Type); 371return MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, loweredRight, loweredRight.Type); 374return MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, loweredLeft, loweredLeft.Type); 628var testOperator = isAnd ? UnaryOperatorKind.DynamicFalse : UnaryOperatorKind.DynamicTrue; 634if (testOperator == UnaryOperatorKind.DynamicFalse && constantLeft == ConstantValue.False || 635testOperator == UnaryOperatorKind.DynamicTrue && constantLeft == ConstantValue.True) 677bool leftTestIsConstantFalse = testOperator == UnaryOperatorKind.DynamicFalse && constantLeft == ConstantValue.True || 678testOperator == UnaryOperatorKind.DynamicTrue && constantLeft == ConstantValue.False; 738return _dynamicFactory.MakeDynamicUnaryOperator(negative ? UnaryOperatorKind.DynamicFalse : UnaryOperatorKind.DynamicTrue, loweredLeft, boolean).ToExpression(); 757return new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, converted, ConstantValue.NotAvailable, MethodSymbol.None, constrainedToTypeOpt: null, LookupResultKind.Viable, boolean) 893MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, callHasValue, boolType) : 1876BoundExpression invert = MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, innerOr, boolType); 2009new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, call, ConstantValue.NotAvailable, null, constrainedToTypeOpt: null, LookupResultKind.Viable, returnType);
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (3)
563return _factory.Not(MakeUnaryOperator(UnaryOperatorKind.DynamicFalse, left.Syntax, method: null, constrainedToTypeOpt: null, dynamicResult, boolType)); 567return MakeUnaryOperator(UnaryOperatorKind.DynamicTrue, left.Syntax, method: null, constrainedToTypeOpt: null, dynamicResult, boolType); 583if (boolOperator.Kind != UnaryOperatorKind.Error)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (67)
34case UnaryOperatorKind.PrefixDecrement: 35case UnaryOperatorKind.PrefixIncrement: 36case UnaryOperatorKind.PostfixDecrement: 37case UnaryOperatorKind.PostfixIncrement: 52if (node.OperatorKind == UnaryOperatorKind.DynamicTrue && binaryOperator.OperatorKind == BinaryOperatorKind.DynamicLogicalOr || 53node.OperatorKind == UnaryOperatorKind.DynamicFalse && binaryOperator.OperatorKind == BinaryOperatorKind.DynamicLogicalAnd) 64UnaryOperatorKind kind, 76UnaryOperatorKind kind, 85Debug.Assert((kind == UnaryOperatorKind.DynamicTrue || kind == UnaryOperatorKind.DynamicFalse) && type.SpecialType == SpecialType.System_Boolean 95case UnaryOperatorKind.DynamicTrue: 97case UnaryOperatorKind.DynamicLogicalNegation: 115if (!_inExpressionLambda || kind == UnaryOperatorKind.UserDefinedTrue || kind == UnaryOperatorKind.UserDefinedFalse) 125else if (kind.Operator() == UnaryOperatorKind.UnaryPlus) 131if (kind == UnaryOperatorKind.EnumBitwiseComplement) 141UnaryOperatorKind newKind = kind.Operator().WithType(upconvertSpecialType); 165if (kind == UnaryOperatorKind.DecimalUnaryMinus) 180UnaryOperatorKind kind, 244UnaryOperatorKind operatorKind, 354private BoundExpression GetLiftedUnaryOperatorConsequence(UnaryOperatorKind kind, SyntaxNode syntax, MethodSymbol? method, TypeSymbol? constrainedToTypeOpt, TypeSymbol type, BoundExpression nonNullOperand) 378var op = node.OperatorKind.Operator(); 379return op == UnaryOperatorKind.PostfixIncrement || op == UnaryOperatorKind.PrefixIncrement; 384var op = node.OperatorKind.Operator(); 385return op == UnaryOperatorKind.PrefixIncrement || op == UnaryOperatorKind.PrefixDecrement; 736if (node.OperatorKind.OperandTypes() == UnaryOperatorKind.UserDefined) 928if (node.OperatorKind.OperandTypes() == UnaryOperatorKind.Pointer) 1058UnaryOperatorKind kind = node.OperatorKind.OperandTypes(); 1063if (kind == UnaryOperatorKind.Enum) 1072case UnaryOperatorKind.Int: 1075case UnaryOperatorKind.SByte: 1078case UnaryOperatorKind.Short: 1081case UnaryOperatorKind.Byte: 1084case UnaryOperatorKind.UShort: 1087case UnaryOperatorKind.Char: 1090case UnaryOperatorKind.UInt: 1093case UnaryOperatorKind.Long: 1096case UnaryOperatorKind.ULong: 1099case UnaryOperatorKind.NInt: 1102case UnaryOperatorKind.NUInt: 1105case UnaryOperatorKind.Float: 1108case UnaryOperatorKind.Double: 1111case UnaryOperatorKind.Decimal: 1114case UnaryOperatorKind.Pointer: 1116case UnaryOperatorKind.UserDefined: 1117case UnaryOperatorKind.Bool: 1138UnaryOperatorKind unaryOperatorKind = node.OperatorKind; 1143case UnaryOperatorKind.Int: 1144case UnaryOperatorKind.SByte: 1145case UnaryOperatorKind.Short: 1148case UnaryOperatorKind.Byte: 1149case UnaryOperatorKind.UShort: 1150case UnaryOperatorKind.Char: 1151case UnaryOperatorKind.UInt: 1154case UnaryOperatorKind.Long: 1157case UnaryOperatorKind.ULong: 1160case UnaryOperatorKind.NInt: 1163case UnaryOperatorKind.NUInt: 1166case UnaryOperatorKind.Float: 1169case UnaryOperatorKind.Double: 1172case UnaryOperatorKind.Decimal: //Dev10 special cased this, but we'll let DecimalRewriter handle it 1175case UnaryOperatorKind.Enum: 1213case UnaryOperatorKind.Pointer: 1216case UnaryOperatorKind.UserDefined: 1217case UnaryOperatorKind.Bool:
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
116UnaryOperatorKind operatorKind,
Lowering\SyntheticBoundNodeFactory.cs (2)
1637return new BoundUnaryOperator(expression.Syntax, UnaryOperatorKind.BoolLogicalNegation, expression, null, null, constrainedToTypeOpt: null, LookupResultKind.Viable, expression.Type); 1884new BoundUnaryOperator(syntax, UnaryOperatorKind.BoolLogicalNegation, call, ConstantValue.NotAvailable, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Viable, returnType);
Operations\CSharpOperationFactory_Methods.cs (13)
495internal static bool IsPostfixIncrementOrDecrement(CSharp.UnaryOperatorKind operatorKind) 499case CSharp.UnaryOperatorKind.PostfixIncrement: 500case CSharp.UnaryOperatorKind.PostfixDecrement: 508internal static bool IsDecrement(CSharp.UnaryOperatorKind operatorKind) 512case CSharp.UnaryOperatorKind.PrefixDecrement: 513case CSharp.UnaryOperatorKind.PostfixDecrement: 521internal static UnaryOperatorKind DeriveUnaryOperatorKind(CSharp.UnaryOperatorKind operatorKind) 525case CSharp.UnaryOperatorKind.UnaryPlus: 528case CSharp.UnaryOperatorKind.UnaryMinus: 531case CSharp.UnaryOperatorKind.LogicalNegation: 534case CSharp.UnaryOperatorKind.BitwiseComplement: 537case CSharp.UnaryOperatorKind.True: 540case CSharp.UnaryOperatorKind.False:
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (10)
Emit\NumericIntPtrTests.cs (10)
1535UnaryOperatorKind.PostfixIncrement, 1536UnaryOperatorKind.PostfixDecrement, 1537UnaryOperatorKind.PrefixIncrement, 1538UnaryOperatorKind.PrefixDecrement, 1539UnaryOperatorKind.UnaryPlus, 1540UnaryOperatorKind.UnaryMinus, 1541UnaryOperatorKind.BitwiseComplement, 1565foreach (var operatorKind in unaryOperators) 1577static void verifyUnaryOperators(CSharpCompilation comp, UnaryOperatorKind operatorKind, bool skipNativeIntegerOperators) 1583int expectedUnsigned = skipNativeIntegerOperators ? 0 : (operatorKind == UnaryOperatorKind.UnaryMinus) ? 0 : 1;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (42)
Semantics\NativeIntegerTests.cs (10)
4775UnaryOperatorKind.PostfixIncrement, 4776UnaryOperatorKind.PostfixDecrement, 4777UnaryOperatorKind.PrefixIncrement, 4778UnaryOperatorKind.PrefixDecrement, 4779UnaryOperatorKind.UnaryPlus, 4780UnaryOperatorKind.UnaryMinus, 4781UnaryOperatorKind.BitwiseComplement, 4805foreach (var operatorKind in unaryOperators) 4817static void verifyUnaryOperators(CSharpCompilation comp, UnaryOperatorKind operatorKind, bool skipNativeIntegerOperators) 4823int expectedUnsigned = skipNativeIntegerOperators ? 0 : (operatorKind == UnaryOperatorKind.UnaryMinus) ? 0 : 1;
Semantics\OperatorTests.cs (32)
7398UnaryOperatorKind[] operators = 7400UnaryOperatorKind.PostfixIncrement, 7401UnaryOperatorKind.PostfixDecrement, 7402UnaryOperatorKind.PrefixIncrement, 7403UnaryOperatorKind.PrefixDecrement, 7404UnaryOperatorKind.UnaryPlus, 7405UnaryOperatorKind.UnaryMinus, 7406UnaryOperatorKind.LogicalNegation, 7407UnaryOperatorKind.BitwiseComplement 7455if (operators[k] == UnaryOperatorKind.PostfixDecrement || operators[k] == UnaryOperatorKind.PostfixIncrement) 7511foreach (var op in operators) 7530UnaryOperatorKind op, 7564if (op == UnaryOperatorKind.BitwiseComplement || 7565op == UnaryOperatorKind.PrefixDecrement || op == UnaryOperatorKind.PrefixIncrement || 7566op == UnaryOperatorKind.PostfixDecrement || op == UnaryOperatorKind.PostfixIncrement) 7571UnaryOperatorKind result = OverloadResolution.UnopEasyOut.OpKind(op, underlying); 7574if (result == UnaryOperatorKind.Error) 7578signature = new UnaryOperatorSignature(op | UnaryOperatorKind.Dynamic, type, type); 7581(op == UnaryOperatorKind.PrefixDecrement || op == UnaryOperatorKind.PrefixIncrement || 7582op == UnaryOperatorKind.PostfixDecrement || op == UnaryOperatorKind.PostfixIncrement)) 7584signature = new UnaryOperatorSignature(op | UnaryOperatorKind.Pointer, type, type); 7613if (op == UnaryOperatorKind.LogicalNegation && type.IsEnumType()) 7630case UnaryOperatorKind.UnaryMinus: 7634case UnaryOperatorKind.PrefixDecrement: 7635case UnaryOperatorKind.PrefixIncrement: 7636case UnaryOperatorKind.PostfixDecrement: 7637case UnaryOperatorKind.PostfixIncrement: