calculate the type from type nodes in AST (wip)