public FactPropertyDescriptor(int index, Value.Type baseType, byte type) : base(index.ToString(), new Attribute[0]) { Index = index; BaseType = baseType; Type = type; }
private Value.Type IntrinsicTypeToCompatibilityType(Value.Type typeId) { switch ((Value.Type)typeId) { case Value.Type.Integer: case Value.Type.Integer64: case Value.Type.Float: return Value.Type.Integer; case Value.Type.String: case Value.Type.GuidString: return Value.Type.String; default: throw new ArgumentException("Cannot check compatibility of unknown types"); } }
/// <summary> /// Returns whether comparing the specified types is "risky", /// i.e. if there is unexpected behavior or side effects. /// </summary> private bool IsRiskyComparison(Value.Type type1, Value.Type type2) { return (type1 == Value.Type.String && type2 == Value.Type.GuidString) || (type1 == Value.Type.GuidString && type2 == Value.Type.String); }
private bool AreIntrinsicTypesCompatible(Value.Type type1, Value.Type type2) { Value.Type translatedType1 = IntrinsicTypeToCompatibilityType(type1), translatedType2 = IntrinsicTypeToCompatibilityType(type2); return translatedType1 == translatedType2; }
private string TypeToName(Value.Type typeId) { return TypeToName((uint)typeId); }