14. A device, comprising: at least one processor and a memory; the at least one processor configured to: perform contextual typing by: receiving a parse tree representing a syntax structure of a program source code, the program source code comprising at least one enclosing expression, the at least one enclosing expression enclosing at least one enclosed expression; and assigning a type of the enclosing expression to the at least one enclosed expression of the parse tree in a top down direction of the parse tree.
14. A device, comprising: at least one processor and a memory; the at least one processor configured to: perform contextual typing by: receiving a parse tree representing a syntax structure of a program source code, the program source code comprising at least one enclosing expression, the at least one enclosing expression enclosing at least one enclosed expression; and assigning a type of the enclosing expression to the at least one enclosed expression of the parse tree in a top down direction of the parse tree. 19. The device of claim 14 , wherein the at least one processor is further configured to: perform contextual typing by assigning a type associated with a return argument of a function to a function literal of the function.