diff --git a/fontes/interpretador/interpretador-base.ts b/fontes/interpretador/interpretador-base.ts index b2d2e60f..19485b71 100644 --- a/fontes/interpretador/interpretador-base.ts +++ b/fontes/interpretador/interpretador-base.ts @@ -454,7 +454,11 @@ export class InterpretadorBase implements InterpretadorInterface { : typeof esquerda === tipoDeDadosPrimitivos.NUMERO ? tipoDeDadosDelegua.NUMERO : String(NaN); - if (tipoDireita === tipoDeDadosDelegua.NUMERO && tipoEsquerda === tipoDeDadosDelegua.NUMERO) return; + + const tiposNumericos = [tipoDeDadosDelegua.INTEIRO, tipoDeDadosDelegua.NUMERO]; + + if(tiposNumericos.includes(tipoDireita) && tiposNumericos.includes(tipoEsquerda)) return; + throw new ErroEmTempoDeExecucao(operador, 'Operadores precisam ser nĂºmeros.', operador.linha); }