@@ -485,10 +485,11 @@ class RecordCloneMethod extends Method, DotNet::RecordCloneCallable {
485
485
* A user-defined unary operator - an operator taking one operand.
486
486
*
487
487
* Either a plus operator (`PlusOperator`), minus operator (`MinusOperator`),
488
- * not operator (`NotOperator`), complement operator (`ComplementOperator`),
489
- * true operator (`TrueOperator`), false operator (`FalseOperator`),
490
- * increment operator (`IncrementOperator`), or decrement operator
491
- * (`DecrementOperator`).
488
+ * checked minus operator (`CheckedMinusOperator`), not operator (`NotOperator`),
489
+ * complement operator (`ComplementOperator`), true operator (`TrueOperator`),
490
+ * false operator (`FalseOperator`), increment operator (`IncrementOperator`),
491
+ * checked increment operator (`CheckedIncrementOperator`), decrement operator
492
+ * (`DecrementOperator`) or checked decrement operator (`CheckedDecrementOperator`).
492
493
*/
493
494
class UnaryOperator extends Operator {
494
495
UnaryOperator ( ) {
@@ -527,6 +528,21 @@ class MinusOperator extends UnaryOperator {
527
528
override string getAPrimaryQlClass ( ) { result = "MinusOperator" }
528
529
}
529
530
531
+ /**
532
+ * A user-defined checked minus operator (`-`), for example
533
+ *
534
+ * ```csharp
535
+ * public static Widget operator checked -(Widget w) {
536
+ * ...
537
+ * }
538
+ * ```
539
+ */
540
+ class CheckedMinusOperator extends UnaryOperator {
541
+ CheckedMinusOperator ( ) { this .getName ( ) = "checked -" }
542
+
543
+ override string getAPrimaryQlClass ( ) { result = "CheckedMinusOperator" }
544
+ }
545
+
530
546
/**
531
547
* A user-defined not operator (`!`), for example
532
548
*
@@ -572,6 +588,21 @@ class IncrementOperator extends UnaryOperator {
572
588
override string getAPrimaryQlClass ( ) { result = "IncrementOperator" }
573
589
}
574
590
591
+ /**
592
+ * A user-defined checked increment operator (`++`), for example
593
+ *
594
+ * ```csharp
595
+ * public static Widget operator checked ++(Widget w) {
596
+ * ...
597
+ * }
598
+ * ```
599
+ */
600
+ class CheckedIncrementOperator extends UnaryOperator {
601
+ CheckedIncrementOperator ( ) { this .getName ( ) = "checked ++" }
602
+
603
+ override string getAPrimaryQlClass ( ) { result = "CheckedIncrementOperator" }
604
+ }
605
+
575
606
/**
576
607
* A user-defined decrement operator (`--`), for example
577
608
*
@@ -587,6 +618,21 @@ class DecrementOperator extends UnaryOperator {
587
618
override string getAPrimaryQlClass ( ) { result = "DecrementOperator" }
588
619
}
589
620
621
+ /**
622
+ * A user-defined checked decrement operator (`--`), for example
623
+ *
624
+ * ```csharp
625
+ * public static Widget operator checked --(Widget w) {
626
+ * ...
627
+ * }
628
+ * ```
629
+ */
630
+ class CheckedDecrementOperator extends UnaryOperator {
631
+ CheckedDecrementOperator ( ) { this .getName ( ) = "checked --" }
632
+
633
+ override string getAPrimaryQlClass ( ) { result = "CheckedDecrementOperator" }
634
+ }
635
+
590
636
/**
591
637
* A user-defined false operator (`false`), for example
592
638
*
@@ -620,9 +666,12 @@ class TrueOperator extends UnaryOperator {
620
666
/**
621
667
* A user-defined binary operator.
622
668
*
623
- * Either an addition operator (`AddOperator`), a subtraction operator
624
- * (`SubOperator`), a multiplication operator (`MulOperator`), a division
625
- * operator (`DivOperator`), a remainder operator (`RemOperator`), an and
669
+ * Either an addition operator (`AddOperator`), a checked addition operator
670
+ * (`CheckedAddOperator`) a subtraction operator (`SubOperator`), a checked
671
+ * substraction operator (`CheckedSubOperator`), a multiplication operator
672
+ * (`MulOperator`), a checked multiplication operator (`CheckedMulOperator`),
673
+ * a division operator (`DivOperator`), a checked division operator
674
+ * (`CheckedDivOperator`), a remainder operator (`RemOperator`), an and
626
675
* operator (`AndOperator`), an or operator (`OrOperator`), an xor
627
676
* operator (`XorOperator`), a left shift operator (`LeftShiftOperator`),
628
677
* a right shift operator (`RightShiftOperator`), an unsigned right shift
@@ -650,6 +699,21 @@ class AddOperator extends BinaryOperator {
650
699
override string getAPrimaryQlClass ( ) { result = "AddOperator" }
651
700
}
652
701
702
+ /**
703
+ * A user-defined checked addition operator (`+`), for example
704
+ *
705
+ * ```csharp
706
+ * public static Widget operator checked +(Widget lhs, Widget rhs) {
707
+ * ...
708
+ * }
709
+ * ```
710
+ */
711
+ class CheckedAddOperator extends BinaryOperator {
712
+ CheckedAddOperator ( ) { this .getName ( ) = "checked +" }
713
+
714
+ override string getAPrimaryQlClass ( ) { result = "CheckedAddOperator" }
715
+ }
716
+
653
717
/**
654
718
* A user-defined subtraction operator (`-`), for example
655
719
*
@@ -665,6 +729,21 @@ class SubOperator extends BinaryOperator {
665
729
override string getAPrimaryQlClass ( ) { result = "SubOperator" }
666
730
}
667
731
732
+ /**
733
+ * A user-defined checked subtraction operator (`-`), for example
734
+ *
735
+ * ```csharp
736
+ * public static Widget operator checked -(Widget lhs, Widget rhs) {
737
+ * ...
738
+ * }
739
+ * ```
740
+ */
741
+ class CheckedSubOperator extends BinaryOperator {
742
+ CheckedSubOperator ( ) { this .getName ( ) = "checked -" }
743
+
744
+ override string getAPrimaryQlClass ( ) { result = "CheckedSubOperator" }
745
+ }
746
+
668
747
/**
669
748
* A user-defined multiplication operator (`*`), for example
670
749
*
@@ -680,6 +759,21 @@ class MulOperator extends BinaryOperator {
680
759
override string getAPrimaryQlClass ( ) { result = "MulOperator" }
681
760
}
682
761
762
+ /**
763
+ * A user-defined checked multiplication operator (`*`), for example
764
+ *
765
+ * ```csharp
766
+ * public static Widget operator checked *(Widget lhs, Widget rhs) {
767
+ * ...
768
+ * }
769
+ * ```
770
+ */
771
+ class CheckedMulOperator extends BinaryOperator {
772
+ CheckedMulOperator ( ) { this .getName ( ) = "checked *" }
773
+
774
+ override string getAPrimaryQlClass ( ) { result = "CheckedMulOperator" }
775
+ }
776
+
683
777
/**
684
778
* A user-defined division operator (`/`), for example
685
779
*
@@ -695,6 +789,21 @@ class DivOperator extends BinaryOperator {
695
789
override string getAPrimaryQlClass ( ) { result = "DivOperator" }
696
790
}
697
791
792
+ /**
793
+ * A user-defined checked division operator (`/`), for example
794
+ *
795
+ * ```csharp
796
+ * public static Widget operator checked /(Widget lhs, Widget rhs) {
797
+ * ...
798
+ * }
799
+ * ```
800
+ */
801
+ class CheckedDivOperator extends BinaryOperator {
802
+ CheckedDivOperator ( ) { this .getName ( ) = "checked /" }
803
+
804
+ override string getAPrimaryQlClass ( ) { result = "CheckedDivOperator" }
805
+ }
806
+
698
807
/**
699
808
* A user-defined remainder operator (`%`), for example
700
809
*
@@ -908,7 +1017,8 @@ class GEOperator extends BinaryOperator {
908
1017
class ConversionOperator extends Operator {
909
1018
ConversionOperator ( ) {
910
1019
this .getName ( ) = "implicit conversion" or
911
- this .getName ( ) = "explicit conversion"
1020
+ this .getName ( ) = "explicit conversion" or
1021
+ this .getName ( ) = "checked explicit conversion"
912
1022
}
913
1023
914
1024
/** Gets the source type of the conversion. */
@@ -948,6 +1058,21 @@ class ExplicitConversionOperator extends ConversionOperator {
948
1058
override string getAPrimaryQlClass ( ) { result = "ExplicitConversionOperator" }
949
1059
}
950
1060
1061
+ /**
1062
+ * A user-defined checked explicit conversion operator, for example
1063
+ *
1064
+ * ```csharp
1065
+ * public static explicit operator checked int(BigInteger i) {
1066
+ * ...
1067
+ * }
1068
+ * ```
1069
+ */
1070
+ class CheckedExplicitConversionOperator extends ConversionOperator {
1071
+ CheckedExplicitConversionOperator ( ) { this .getName ( ) = "checked explicit conversion" }
1072
+
1073
+ override string getAPrimaryQlClass ( ) { result = "CheckedExplicitConversionOperator" }
1074
+ }
1075
+
951
1076
/**
952
1077
* A local function, defined within the scope of another callable.
953
1078
* For example, `Fac` on lines 2--4 in
0 commit comments