You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/graindoc/docblock.re
+58-20Lines changed: 58 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ open Grain_utils;
4
4
openGrain_diagnostics;
5
5
6
6
typeparam= {
7
-
param_name:string,
7
+
param_id:string,
8
8
param_type:string,
9
9
param_msg:string,
10
10
};
@@ -77,7 +77,8 @@ exception
77
77
attr: string,
78
78
});
79
79
80
-
exceptionMissingParamType({name: string});
80
+
exceptionMissingLabeledParamType({name: string});
81
+
exceptionMissingUnlabeledParamType({idx: int});
81
82
exceptionMissingReturnType;
82
83
exception
83
84
InvalidAttribute({
@@ -96,11 +97,19 @@ let () =
96
97
attr,
97
98
);
98
99
Some(msg);
99
-
|MissingParamType({name}) =>
100
+
|MissingLabeledParamType({name}) =>
100
101
letmsg=
101
102
Printf.sprintf(
102
-
"Unable to find a type for %s. Did you specify too many @param attributes?",
103
+
"Unable to find a matching function parameter for %s. Make sure a parameter exists with this label or use `@param <param_index> %s` for unlabeled parameters.",
103
104
name,
105
+
name,
106
+
);
107
+
Some(msg);
108
+
|MissingUnlabeledParamType({idx}) =>
109
+
letmsg=
110
+
Printf.sprintf(
111
+
"Unable to find a type for parameter at index %d. Make sure a parameter exists at this index in the parameter list.",
112
+
idx,
104
113
);
105
114
Some(msg);
106
115
|MissingReturnType=>
@@ -161,8 +170,8 @@ let output_for_params = params => {
0 commit comments