(&self)
| 294 | pub signature: Signature, |
| 295 | pub debug_variables: Vec<DebugVariable>, |
| 296 | pub body: CodeBlock, |
| 297 | } |
| 298 | |
| 299 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
| 300 | pub struct Signature { |
| 301 | pub params: Vec<(String, Type)>, |
| 302 | pub ret: Box<Type>, |
| 303 | pub is_static: bool, |
| 304 | } |
| 305 | |
| 306 | impl Signature { |
| 307 | /// Whether the first OOMIR parameter is represented by the JVM's implicit |
| 308 | /// receiver slot rather than appearing in the method descriptor. |
| 309 | pub fn has_implicit_jvm_receiver(&self) -> bool { |
| 310 | !self.is_static |
| 311 | && self |
| 312 | .params |
| 313 | .first() |
| 314 | .is_some_and(|(_, ty)| ty.is_jvm_reference_type()) |
| 315 | } |
| 316 | |
| 317 | pub fn explicit_jvm_params(&self) -> &[(String, Type)] { |
| 318 | if self.has_implicit_jvm_receiver() { |
| 319 | &self.params[1..] |
| 320 | } else { |
| 321 | &self.params |
no test coverage detected