@@ -308,7 +308,8 @@ defmodule Module.Types.Expr do
308308 Of . map_fetch ( expr , type , key_or_fun , stack , context )
309309 else
310310 { mods , context } = Of . remote ( type , key_or_fun , 0 , [ :dot ] , expr , meta , stack , context )
311- apply_many ( mods , key_or_fun , [ ] , expr , stack , context )
311+ { type , context } = apply_many ( mods , key_or_fun , [ ] , expr , stack , context )
312+ { :ok , type , context }
312313 end
313314 end
314315 end
@@ -318,7 +319,8 @@ defmodule Module.Types.Expr do
318319 with { :ok , remote_type , context } <- of_expr ( remote , stack , context ) ,
319320 { :ok , args_types , context } <- map_reduce_ok ( args , context , & of_expr ( & 1 , stack , & 2 ) ) do
320321 { mods , context } = Of . remote ( remote_type , name , length ( args ) , expr , meta , stack , context )
321- apply_many ( mods , name , args_types , expr , stack , context )
322+ { type , context } = apply_many ( mods , name , args_types , expr , stack , context )
323+ { :ok , type , context }
322324 end
323325 end
324326
@@ -464,20 +466,20 @@ defmodule Module.Types.Expr do
464466 defp error_type ( ) , do: dynamic ( )
465467
466468 defp apply_many ( [ ] , _function , _args_types , _expr , _stack , context ) do
467- { :ok , dynamic ( ) , context }
469+ { dynamic ( ) , context }
468470 end
469471
470472 defp apply_many ( [ mod ] , function , args_types , expr , stack , context ) do
471473 Of . apply ( mod , function , args_types , expr , stack , context )
472474 end
473475
474476 defp apply_many ( mods , function , args_types , expr , stack , context ) do
475- with { :ok , returns , context } <-
476- map_reduce_ok ( mods , context , fn mod , context ->
477- Of . apply ( mod , function , args_types , expr , stack , context )
478- end ) do
479- { :ok , Enum . reduce ( returns , & union / 2 ) , context }
480- end
477+ { returns , context } =
478+ Enum . map_reduce ( mods , context , fn mod , context ->
479+ Of . apply ( mod , function , args_types , expr , stack , context )
480+ end )
481+
482+ { Enum . reduce ( returns , & union / 2 ) , context }
481483 end
482484
483485 defp of_clauses ( clauses , stack , context ) do
0 commit comments