We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5d052a commit f6684e8Copy full SHA for f6684e8
plugin/doc_comment.js
@@ -419,7 +419,10 @@
419
fn.argNames[i] += "?";
420
if (known) propagateWithWeight(known, fn.args[i]);
421
}
422
- if (ret) propagateWithWeight(ret, fn.retval);
+ if (ret) {
423
+ if (fn.retval == infer.ANull) fn.retval = new infer.AVal;
424
+ propagateWithWeight(ret, fn.retval);
425
+ }
426
if (self) propagateWithWeight(self, fn.self);
427
} else if (type) {
428
propagateWithWeight(type, aval);
test/cases/jsdoc.js
@@ -105,3 +105,10 @@ stringOrNumber; //: string|number
105
function unionFunction(a) { return argh(); }
106
107
unionFunction; //: fn(a: string) -> [Foo|number]
108
+
109
+/**
110
+ * @returns {string}
111
+ */
112
+function ui() {}
113
114
+ui(); //: string
0 commit comments