private boolean isOrContains ( SoyType type , SoyType . Kind kind ) { if ( type . getKind ( ) == kind ) { return true ; } if ( type . getKind ( ) == SoyType . Kind . UNION ) { for ( SoyType member : ( ( UnionType ) type ) . getMembers ( ) ) { if ( member . getKind ( ) == kind ) { return true ; } } } return false ; }
Returns true if the type is the given kind or contains the given kind .