from typing import Dict

from boa3.model.builtin.interop.interopmethod import InteropMethod
from boa3.model.builtin.interop.iterator.iteratortype import IteratorType
from boa3.model.variable import Variable


class IteratorNextMethod(InteropMethod):
    def __init__(self):
        from boa3.model.type.type import Type
        syscall = 'System.Iterator.Next'
        identifier = '-iterator_next'
        args: Dict[str, Variable] = {'self': Variable(IteratorType.build())}
        super().__init__(identifier, syscall, args, return_type=Type.bool)
