fn tapply_should_be_tgeneric(
        &self,
        reason: &'a Reason<'a>,
        id: nast::Sid<'a>,
    ) -> Option<&'a str> {
        match reason.pos() {
            // If the name contained a namespace delimiter in the original
            // source text, then it can't have referred to a type parameter
            // (since type parameters cannot be namespaced).
            Some(pos) => {
                if self.source_text_at_pos(pos).contains(&b'\\') {
                    return None;
                }
            }
            None => return None,
        }
        // However, the direct decl parser will unconditionally prefix
        // the name with the current namespace (as it does for any
        // Tapply). We need to remove it.
        match id.1.rsplit('\\').next() {
            Some(name) if self.is_type_param_in_scope(name) => return Some(name),
            _ => return None,
        }
    }
// This is the logic for determining if convert_tapply_to_tgeneric should turn
// a Tapply into a Tgeneric
This is the logic for determining if convert_tapply_to_tgeneric should turn
a Tapply into a Tgeneric
This is the logic for determining if convert_tapply_to_tgeneric should turn a Tapply into a Tgeneric
fn tapply_should_be_tgeneric(
        &self,
        reason: &'a Reason<'a>,
        id: nast::Sid<'a>,
    ) -> Option<&'a str> {
        match reason.pos() {
            // If the name contained a namespace delimiter in the original
            // source text, then it can't have referred to a type parameter
            // (since type parameters cannot be namespaced).
            Some(pos) => {
                if self.source_text_at_pos(pos).contains(&b'\\') {
                    return None;
                }
            }
            None => return None,
        }
        // However, the direct decl parser will unconditionally prefix
        // the name with the current namespace (as it does for any
        // Tapply). We need to remove it.
        match id.1.rsplit('\\').next() {
            Some(name) if self.is_type_param_in_scope(name) => return Some(name),
            _ => return None,
        }
    }
fn tapply_should_be_tgeneric ( & self , reason : & ' a Reason < ' a > , id : nast :: Sid < ' a > , ) -> Option < & ' a str > { match reason . pos ( ) { // If the name contained a namespace delimiter in the original // source text, then it can't have referred to a type parameter // (since type parameters cannot be namespaced). Some ( pos ) => { if self . source_text_at_pos ( pos ) . contains ( & b'\\' ) { return None ; } } None => return None , } // However, the direct decl parser will unconditionally prefix // the name with the current namespace (as it does for any // Tapply). We need to remove it. match id . 1 . rsplit ( '\\' ) . next ( ) { Some ( name ) if self . is_type_param_in_scope ( name ) => return Some ( name ) , _ => return None , } }
This is the logic for determining if convert_tapply_to_tgeneric should turn
a Tapply into a Tgeneric
This is the logic for determining if convert_tapply_to_tgeneric should turn a Tapply into a Tgeneric
&self
reason
&'a Reason<'a>
id
nast::Sid<'a>