public override void DoUnify(DataType var, Substitution substitution) { if (Name != var.Name || Arguments.Count != var.Arguments.Count) { throw TypeException.Create(this.Perform(substitution), var.Perform(substitution)); } for (var i = 0; i < Arguments.Count; ++i) { Arguments[i].Perform(substitution).Unify(var.Arguments[i].Perform(substitution), substitution); } }
public void TestTypeException() { TypeException exception = null; try { Helper.ParseLine("Q 1 2 3 4"); }catch (TypeException ex) { exception = ex; } Assert.AreEqual(typeof(TypeException), exception.GetType()); }
public MyProgramException(string message, TypeException type) : base(message) { this.Type = type; }
public virtual void DoUnify(Type that, Substitution substitution) { throw TypeException.Create(Perform(substitution), that.Perform(substitution)); }