File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,9 @@ class EnumType extends Type, TEnum {
140140
141141 EnumType ( ) { this = TEnum ( enum ) }
142142
143+ /** Gets the enum that this enum type represents. */
144+ Enum getEnum ( ) { result = enum }
145+
143146 override TypeParameter getPositionalTypeParameter ( int i ) {
144147 result = TTypeParamTypeParameter ( enum .getGenericParamList ( ) .getTypeParam ( i ) )
145148 }
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ class IntegralTypeBarrier extends DataFlow::Node {
3434 }
3535}
3636
37+ /** A node whose type is a fieldless enum. */
38+ class FieldlessEnumTypeBarrier extends DataFlow:: Node {
39+ FieldlessEnumTypeBarrier ( ) {
40+ TypeInference:: inferType ( this .asExpr ( ) ) .( EnumType ) .getEnum ( ) .isFieldless ( )
41+ }
42+ }
43+
3744/**
3845 * Holds if guard expression `g` having result `branch` indicates that the
3946 * sub-expression `e` is not null. For example when `ptr.is_null()` is
You can’t perform that action at this time.
0 commit comments