Returns true if the function is a fallible constructor. Fallible constructors are constructors that return `result ` instead of just `T`. In the generated C++ code, these become static factory methods named `Create` that return `std::expected `, rather than regular constructors.
(&self, resolve: &Resolve, func: &Function)
| 303 | /// In the generated C++ code, these become static factory methods named `Create` that |
| 304 | /// return `std::expected<T, E>`, rather than regular constructors. |
| 305 | fn is_fallible_constructor(&self, resolve: &Resolve, func: &Function) -> bool { |
| 306 | matches!(&func.kind, FunctionKind::Constructor(_)) |
| 307 | && func.result.as_ref().is_some_and(|ty| { |
| 308 | if let Type::Id(id) = ty { |
| 309 | matches!(&resolve.types[*id].kind, TypeDefKind::Result(_)) |
| 310 | } else { |
| 311 | false |
| 312 | } |
| 313 | }) |
| 314 | } |
| 315 | |
| 316 | fn interface<'a>( |
| 317 | &'a mut self, |
no outgoing calls
no test coverage detected