Remove duplicate methods and fields
(&mut self)
| 189 | let mut unique_methods = HashMap::default(); |
| 190 | for (name, method) in methods.iter() { |
| 191 | unique_methods.insert(name.clone(), method.clone()); |
| 192 | } |
| 193 | *methods = unique_methods; |
| 194 | } |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | #[derive(Debug, Clone, PartialEq)] |
| 200 | pub struct Function { |
| 201 | pub name: String, |
| 202 | pub owner_class: Option<String>, |
| 203 | pub signature: Signature, |
| 204 | pub debug_variables: Vec<DebugVariable>, |
| 205 | pub body: CodeBlock, |
| 206 | } |
| 207 | |
| 208 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
| 209 | pub struct Signature { |
| 210 | pub params: Vec<(String, Type)>, |
| 211 | pub ret: Box<Type>, |
| 212 | pub is_static: bool, |
| 213 | } |
| 214 | |
| 215 | impl Signature { |
| 216 | /// Whether the first OOMIR parameter is represented by the JVM's implicit |
| 217 | /// receiver slot rather than appearing in the method descriptor. |
| 218 | pub fn has_implicit_jvm_receiver(&self) -> bool { |
| 219 | !self.is_static |
| 220 | && self |
| 221 | .params |
| 222 | .first() |
| 223 | .is_some_and(|(_, ty)| ty.is_jvm_reference_type()) |
no outgoing calls
no test coverage detected