MCPcopy Create free account
hub / github.com/amber-lang/amber / into_fun_declaration

Method into_fun_declaration

src/utils/function_interface.rs:19–41  ·  view source on GitHub ↗
(self, id: usize)

Source from the content-addressed store, hash-verified

17
18impl FunctionInterface {
19 pub fn into_fun_declaration(self, id: usize) -> FunctionDecl {
20 let is_args_typed = self.args.iter().all(|arg| arg.kind != Type::Generic);
21 let args = self
22 .args
23 .into_iter()
24 .map(|arg| FunctionDeclArg {
25 name: arg.name,
26 kind: arg.kind,
27 optional: arg.optional,
28 is_ref: arg.is_ref,
29 })
30 .collect();
31
32 FunctionDecl {
33 name: self.name,
34 args,
35 returns: self.returns,
36 is_args_typed,
37 is_public: self.is_public,
38 is_failable: self.is_failable,
39 id,
40 }
41 }
42
43 pub fn into_fun_instance(
44 self,

Calls

no outgoing calls