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 {
754
754
*
755
755
* ```go
756
756
* x.(T)
757
+ * x.(type)
757
758
* ```
758
759
*/
759
760
class TypeAssertExpr extends @typeassertexpr, Expr {
760
761
/** Gets the base expression whose type is being asserted. */
761
762
Expr getExpr ( ) { result = this .getChildExpr ( 0 ) }
762
763
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
+ */
764
770
Expr getTypeExpr ( ) { result = this .getChildExpr ( 1 ) }
765
771
766
772
override predicate mayHaveOwnSideEffects ( ) { any ( ) }
You can’t perform that action at this time.
0 commit comments