File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -754,13 +754,19 @@ class SliceExpr extends @sliceexpr, Expr {
754754 *
755755 * ```go
756756 * x.(T)
757+ * x.(type)
757758 * ```
758759 */
759760class TypeAssertExpr extends @typeassertexpr, Expr {
760761 /** Gets the base expression whose type is being asserted. */
761762 Expr getExpr ( ) { result = this .getChildExpr ( 0 ) }
762763
763- /** Gets the expression representing the asserted type. */
764+ /**
765+ * Gets the expression representing the asserted type.
766+ *
767+ * Note that this is not defined when the type assertion is of the form
768+ * `x.(type)`, as found in type switches.
769+ */
764770 Expr getTypeExpr ( ) { result = this .getChildExpr ( 1 ) }
765771
766772 override predicate mayHaveOwnSideEffects ( ) { any ( ) }
You can’t perform that action at this time.
0 commit comments