fn used_types(&self) -> impl Iterator<Item = &TypeDebug> {
        self.chunks
            .iter()
            .filter_map(|chunk| {
                if let ChunkExtra::Procedure(procedure) = &chunk.extra {
                    Some(procedure.used_types())
                } else {
                    None
                }
            })
            .flatten()
            .chain(self.globals_debug.iter().map(|global| &global.var_type))
            .chain(
                self.classes_debug
                    .iter()
                    .flat_map(|(_, class)| class.used_types()),
            )
    }
// Collect all types appeared in the program
Collect all types appeared in the program
Collect all types appeared in the program
fn used_types(&self) -> impl Iterator<Item = &TypeDebug> {
        self.chunks
            .iter()
            .filter_map(|chunk| {
                if let ChunkExtra::Procedure(procedure) = &chunk.extra {
                    Some(procedure.used_types())
                } else {
                    None
                }
            })
            .flatten()
            .chain(self.globals_debug.iter().map(|global| &global.var_type))
            .chain(
                self.classes_debug
                    .iter()
                    .flat_map(|(_, class)| class.used_types()),
            )
    }
fn used_types ( & self ) -> impl Iterator < Item = & TypeDebug > { self . chunks . iter ( ) . filter_map ( | chunk | { if let ChunkExtra :: Procedure ( procedure ) = & chunk . extra { Some ( procedure . used_types ( ) ) } else { None } } ) . flatten ( ) . chain ( self . globals_debug . iter ( ) . map ( | global | & global . var_type ) ) . chain ( self . classes_debug . iter ( ) . flat_map ( | ( _ , class ) | class . used_types ( ) ) , ) }
Collect all types appeared in the program
Collect all types appeared in the program
&self