diff --git a/docs/v2/index.html b/docs/v2/index.html index c39694709b..927c539d57 100644 --- a/docs/v2/index.html +++ b/docs/v2/index.html @@ -2465,7 +2465,7 @@

Everything is an Expression (at least, as much as possible)

alert((function() { try { - return nonexistent / void 0; + return nonexistent / void 0; } catch (error1) { error = error1; return `And the error is ... ${error}`; @@ -2829,7 +2829,7 @@

The Existential Operator

var ref, zip;
 
-zip = typeof lottery.drawWinner === "function" ? (ref = lottery.drawWinner().address) != null ? ref.zipcode : void 0 : void 0;
+zip = typeof lottery.drawWinner === "function" ? (ref = lottery.drawWinner().address) != null ? ref.zipcode : void 0 : void 0;
 
@@ -4588,28 +4588,50 @@

Type Annotations

# @flow
 
-fn = (str ###: string ###, num ###: number ###) ###: string ### ->
-  str + num
+###::
+type Obj = {
+  num: number,
+};
+###
+
+fn = (str ###: string ###, obj ###: Obj ###) ###: string ### ->
+  str + obj.num
 
// @flow
 var fn;
 
-fn = function(str/*: string */, num/*: number */)/*: string */ {
-  return str + num;
+/*::
+type Obj = {
+  num: number,
+};
+*/
+fn = function(str/*: string */, obj/*: Obj */)/*: string */ {
+  return str + obj.num;
 };
 
diff --git a/documentation/examples/type_annotations.coffee b/documentation/examples/type_annotations.coffee index 98c3f3da37..5e8c2ecce1 100644 --- a/documentation/examples/type_annotations.coffee +++ b/documentation/examples/type_annotations.coffee @@ -1,4 +1,10 @@ # @flow -fn = (str ###: string ###, num ###: number ###) ###: string ### -> - str + num +###:: +type Obj = { + num: number, +}; +### + +fn = (str ###: string ###, obj ###: Obj ###) ###: string ### -> + str + obj.num