private void enforceType(Json.Type type) { if (this.type != type) { JsonException.FromInvalidType("Invalid data type", type, this.type); } }
private Json(Json.Type type) { this.type = type; }
public static void FromInvalidType(string message, Json.Type got, Json.Type actualType) { throw new JsonException($"{message}: type wanted '{got}' however current type is '{Convert.ToString(actualType)}'"); }