public void DetectsIncompatibleOperandsInOperation() { ITypeCheckExpr expr = tcFactory.Add(tcFactory.Bool(true), tcFactory.Int(100)); ErrorManager errMngr = new ErrorManager(); expr.TypeCheck(new TypeEnvironment(errMngr)); Assert.True(errMngr.HasErrors); }
public void DetectsNonBoolConditions() { ITypeCheckExpr expr = tcFactory.IfElse(tcFactory.Int(5), tcFactory.String("True"), tcFactory.String("False")); ErrorManager errMngr = new ErrorManager(); expr.TypeCheck(new TypeEnvironment(errMngr)); Assert.True(errMngr.HasErrors); }