浏览代码

Document function signature type

David Peter 2 年之前
父节点
当前提交
d0f6cb71e1
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      numbat/src/typechecker.rs

+ 10 - 2
numbat/src/typechecker.rs

@@ -352,8 +352,16 @@ fn evaluate_const_expr(expr: &typed_ast::Expression) -> Result<Exponent> {
 #[derive(Clone, Default)]
 #[derive(Clone, Default)]
 pub struct TypeChecker {
 pub struct TypeChecker {
     identifiers: HashMap<String, Type>,
     identifiers: HashMap<String, Type>,
-    function_signatures:
-        HashMap<String, (Span, Vec<(Span, String)>, Vec<(Span, Type)>, bool, DType)>,
+    function_signatures: HashMap<
+        String,
+        (
+            Span,                // span of the function definition
+            Vec<(Span, String)>, // type parameters
+            Vec<(Span, Type)>,   // parameter types
+            bool,                // whether or not the function is variadic
+            DType,               // return type
+        ),
+    >,
     registry: DimensionRegistry,
     registry: DimensionRegistry,
 }
 }