StopIteration withou no reasons inside jitclass

I was trying to optimize a class using jitclass. This class receive two objects from two different classes that were optimized with Numba jitclass as well. However, trying to execute this third class using jitclass I receive a message: StopIteration and code stop the execution.

from typing import List

from numba import typed, types
from numba.core.typing.typeof import typeof
from numba.experimental import jitclass
from numba.core.types import Array, DictType, ListType, float64, int8, string, int64
import numpy as np
from tqdm import tqdm

from src.codename.board import Board
from src.codename.card import Card
from src.codename.strategy import Strategy
from src.utils.files import read_embedding
from src.utils.paths import ROOT_DIR

spec = [
    ("_board", Board.class_type.instance_type),
    ("_strategy", Strategy.class_type.instance_type),
    ("_current_player", int8),
    ("_n_cards_for_clue", int8),

class Game:
    def __init__(self, board: Board, strategy: Strategy):
        self._board = board
        self._strategy = strategy
        self._current_player = 1
        self._n_cards_for_clue = 3

    def get_cards(self) -> List[Card]:

    def n_cards_for_clue(self) -> int:
        return self._n_cards_for_clue

    def current_player(self) -> int:
        return self._current_player

    def _get_not_revealed_cards(self):

        cards =
        temp_cards = []

        for i in range(len(cards)):
            if (
                self._current_player == 1
                and cards[i].card_type == 1
                and cards[i].revealed == False
            if (
                self._current_player == 2
                and cards[i].card_type == 2
                and cards[i].revealed == False

        return temp_cards

    def _select_n_cards_for_clue(self):

        temp_cards = self._get_not_revealed_cards()
        selected_cards = self._strategy.select_cards(temp_cards)
        return selected_cards

    def _select_clue(self, selected_cards) -> str:

        ten_k_words = self._board.sampled_words
        cards =

        clue = self._strategy.select_clue(cards, selected_cards, ten_k_words)

        return clue

    def give_clue(self) -> str:
        Return a clue for a specific group of cards for each player.

        Return a string as clue. This clue is calculate using various strategy.
        One of them is minimax using embedding for string.

        clue: str
            Return a clue for each game round.


        selected_cards = self._select_n_cards_for_clue()
        clue = self._select_clue(selected_cards)

        return clue

    def next_player(self):

        if self._current_player == 1:
            self._current_player = 2
            self._current_player = 1

    def reset(self):
        self._current_player = 1

    def verify_status(self) -> int:
        cards =
        cards_1 = []
        cards_2 = []

        for i in range(len(cards)):
            if cards[i].card_type == 1:
            if cards[i].card_type == 2:

        count_number_1 = 0
        for card in cards_1:
            if card.revealed == True:
                count_number_1 += 1
        if len(cards_1) == count_number_1:
            return 1

        count_number_2 = 0
        for card in cards_2:
            if card.revealed == True:
                count_number_2 += 1
        if len(cards_2) == count_number_2:
            return 2

        return 0

Hi @FelipeMarcelino,

Thanks for sharing this, nothing jumps out as an obvious problem, in part because the example cannot be run and debugged. I suggest trying to reduce the problem to a self contained minimal working reproducer (i.e. someone could just run python and it’d show the problem) at which point I expect it can be figured out or reported as a bug in the compiler.