# Path: javadecompiler/Krakatau/ssa/objtypes.py
# def isSubtype(env, x, y):
# def commonSupertype(env, tts):
# def verifierToSynthetic_seq(vtypes):
# def verifierToSynthetic(vtype):
# def declTypeToActual(env, decltype):


import itertools, math
from ..ssa import objtypes
from .stringescape import escapeString
            self.name = self.func(self)
        return self.name

class MethodInvocation(JavaExpression):
    def __init__(self, left, name, tts, arguments, op, dtype):
        if left is None:
            self.params = arguments
        else:
            self.params = [left] + arguments
        self.hasLeft = (left is not None)
        self.dtype = dtype
        self.name = name
        self.tts = tts
        self.op = op #keep around for future reference and new merging

    def print_(self, printer, print_):
        cls, name, desc = self.op.target, self.op.name, self.op.desc
        if name != self.name:
            assert(name == '<init>')
            name = self.name
        else:
            name = escapeString(printer.methodName(cls, name, desc))

        if self.hasLeft:
            left, arguments = self.params[0], self.params[1:]
            return '{}.{}({})'.format(print_(left), name, ', '.join(print_(x) for x in arguments))
        else:
            arguments = self.params
            return '{}({})'.format(name, ', '.join(print_(x) for x in arguments))


# Path: javadecompiler/Krakatau/ssa/objtypes.py
# def isSubtype(env, x, y):
# def commonSupertype(env, tts):
# def verifierToSynthetic_seq(vtypes):
# def verifierToSynthetic(vtype):
# def declTypeToActual(env, decltype):


# Path: javadecompiler/Krakatau/java/ast.py
import itertools, math
from ..ssa import objtypes
from .stringescape import escapeString

            self.name = self.func(self)
        return self.name

class MethodInvocation(JavaExpression):
    def __init__(self, left, name, tts, arguments, op, dtype):
        if left is None:
            self.params = arguments
        else:
            self.params = [left] + arguments
        self.hasLeft = (left is not None)
        self.dtype = dtype
        self.name = name
        self.tts = tts
        self.op = op #keep around for future reference and new merging

    def print_(self, printer, print_):
        cls, name, desc = self.op.target, self.op.name, self.op.desc
        if name != self.name:
            assert(name == '<init>')
            name = self.name
        else:
            name = escapeString(printer.methodName(cls, name, desc))

        if self.hasLeft:
            left, arguments = self.params[0], self.params[1:]
            return '{}.{}({})'.format(print_(left), name, ', '.join(print_(x) for x in arguments))
        else:
            arguments = self.params
            return '{}({})'.format(name, ', '.join(print_(x) for x in arguments))


    def addCasts_sub(self, env):