@@ -76,7 +76,7 @@ defmodule Module.Types.Expr do
7676    do:  { empty_list ( ) ,  context } 
7777
7878  # [expr, ...] 
79-   # TODO : here 
79+   # PENDING : here 
8080  def  of_expr ( list ,  _expected ,  expr ,  stack ,  context )  when  is_list ( list )  do 
8181    { prefix ,  suffix }  =  unpack_list ( list ,  [ ] ) 
8282    { prefix ,  context }  =  Enum . map_reduce ( prefix ,  context ,  & of_expr ( & 1 ,  @ pending ,  expr ,  stack ,  & 2 ) ) 
@@ -90,7 +90,7 @@ defmodule Module.Types.Expr do
9090  end 
9191
9292  # {left, right} 
93-   # TODO : here 
93+   # PENDING : here 
9494  def  of_expr ( { left ,  right } ,  _expected ,  expr ,  stack ,  context )  do 
9595    { left ,  context }  =  of_expr ( left ,  @ pending ,  expr ,  stack ,  context ) 
9696    { right ,  context }  =  of_expr ( right ,  @ pending ,  expr ,  stack ,  context ) 
@@ -103,7 +103,7 @@ defmodule Module.Types.Expr do
103103  end 
104104
105105  # {...} 
106-   # TODO : here 
106+   # PENDING : here 
107107  def  of_expr ( { :{} ,  _meta ,  exprs } ,  _expected ,  expr ,  stack ,  context )  do 
108108    { types ,  context }  =  Enum . map_reduce ( exprs ,  context ,  & of_expr ( & 1 ,  @ pending ,  expr ,  stack ,  & 2 ) ) 
109109
@@ -153,7 +153,7 @@ defmodule Module.Types.Expr do
153153
154154  # %{map | ...} 
155155  # TODO: Once we support typed structs, we need to type check them here. 
156-   # TODO : here 
156+   # PENDING : here 
157157  def  of_expr ( { :%{} ,  meta ,  [ { :| ,  _ ,  [ map ,  args ] } ] }  =  expr ,  _expected ,  _expr ,  stack ,  context )  do 
158158    { map_type ,  context }  =  of_expr ( map ,  @ pending ,  expr ,  stack ,  context ) 
159159
@@ -195,7 +195,7 @@ defmodule Module.Types.Expr do
195195  # Note this code, by definition, adds missing struct fields to `map` 
196196  # because at runtime we do not check for them (only for __struct__ itself). 
197197  # TODO: Once we support typed structs, we need to type check them here. 
198-   # TODO : here 
198+   # PENDING : here 
199199  def  of_expr ( 
200200        { :% ,  struct_meta ,  [ module ,  { :%{} ,  _ ,  [ { :| ,  update_meta ,  [ map ,  args ] } ] } ] }  =  expr , 
201201        _expected , 
@@ -222,13 +222,13 @@ defmodule Module.Types.Expr do
222222  end 
223223
224224  # %{...} 
225-   # TODO : here 
225+   # PENDING : here 
226226  def  of_expr ( { :%{} ,  _meta ,  args } ,  _expected ,  expr ,  stack ,  context )  do 
227227    Of . closed_map ( args ,  stack ,  context ,  & of_expr ( & 1 ,  @ pending ,  expr ,  & 2 ,  & 3 ) ) 
228228  end 
229229
230230  # %Struct{} 
231-   # TODO : here 
231+   # PENDING : here 
232232  def  of_expr ( { :% ,  meta ,  [ module ,  { :%{} ,  _ ,  args } ] } ,  _expected ,  expr ,  stack ,  context )  do 
233233    Of . struct_instance ( module ,  args ,  meta ,  stack ,  context ,  & of_expr ( & 1 ,  @ pending ,  expr ,  & 2 ,  & 3 ) ) 
234234  end 
@@ -281,9 +281,9 @@ defmodule Module.Types.Expr do
281281    |>  dynamic_unless_static ( stack ) 
282282  end 
283283
284-   # TODO: here 
285284  def  of_expr ( { :case ,  meta ,  [ case_expr ,  [ { :do ,  clauses } ] ] } ,  expected ,  expr ,  stack ,  context )  do 
286285    { case_type ,  context }  =  of_expr ( case_expr ,  @ pending ,  case_expr ,  stack ,  context ) 
286+     info  =  { :case ,  meta ,  case_type ,  case_expr } 
287287
288288    # If we are only type checking the expression and the expression is a literal, 
289289    # let's mark it as generated, as it is most likely a macro code. However, if 
@@ -293,14 +293,7 @@ defmodule Module.Types.Expr do
293293    else 
294294      clauses 
295295    end 
296-     |>  of_clauses ( 
297-       [ case_type ] , 
298-       expected , 
299-       expr , 
300-       { :case ,  meta ,  case_type ,  case_expr } , 
301-       stack , 
302-       { none ( ) ,  context } 
303-     ) 
296+     |>  of_clauses ( [ case_type ] ,  expected ,  expr ,  info ,  stack ,  { none ( ) ,  context } ) 
304297    |>  dynamic_unless_static ( stack ) 
305298  end 
306299
@@ -313,24 +306,15 @@ defmodule Module.Types.Expr do
313306    { fun ( ) ,  context } 
314307  end 
315308
316-   # TODO: here 
317309  def  of_expr ( { :try ,  _meta ,  [ [ do:  body ]  ++  blocks ] } ,  expected ,  expr ,  stack ,  original )  do 
318310    { after_block ,  blocks }  =  Keyword . pop ( blocks ,  :after ) 
319311    { else_block ,  blocks }  =  Keyword . pop ( blocks ,  :else ) 
320312
321313    { type ,  context }  = 
322314      if  else_block  do 
323315        { type ,  context }  =  of_expr ( body ,  @ pending ,  body ,  stack ,  original ) 
324- 
325-         of_clauses ( 
326-           else_block , 
327-           [ type ] , 
328-           expected , 
329-           expr , 
330-           { :try_else ,  type } , 
331-           stack , 
332-           { none ( ) ,  context } 
333-         ) 
316+         info  =  { :try_else ,  type } 
317+         of_clauses ( else_block ,  [ type ] ,  expected ,  expr ,  info ,  stack ,  { none ( ) ,  context } ) 
334318      else 
335319        of_expr ( body ,  expected ,  expr ,  stack ,  original ) 
336320      end 
@@ -373,7 +357,6 @@ defmodule Module.Types.Expr do
373357
374358  @ timeout_type  union ( integer ( ) ,  atom ( [ :infinity ] ) ) 
375359
376-   # TODO: here 
377360  def  of_expr ( { :receive ,  _meta ,  [ blocks ] } ,  expected ,  expr ,  stack ,  original )  do 
378361    blocks 
379362    |>  Enum . reduce ( { none ( ) ,  original } ,  fn 
0 commit comments