public Value(IType type, IValue val) { if (!type.Check(val)) { throw new TypeException("Attempted to create value with mismatched type!"); } Type = type; value = val.Get <object>(); }
public bool Check(IValue val) { return(Check(val.Type) || ((parentValue == null ? true : parentValue.Check(val)) && val.Type.RawTypeOf == RawTypeOf && Predicate.Operator("()", val).Equals(ValueFactory.make(true)))); }