Merge pull request #1461 from wilzbach/enforce
[Trivial] Fix deprecation messages for enforceEx
commit cdfb88b7b4feda05eb11411948ebb294e5224461
2 parents a2ac810 + 4be3037
@Sönke Ludwig Sönke Ludwig authored on 6 May 2018
GitHub committed on 6 May 2018
Showing 1 changed file
View
16
source/dub/internal/vibecompat/data/json.d
package template isJsonSerializable(T) { enum isJsonSerializable = is(typeof(T.init.toJson()) == Json) && is(typeof(T.fromJson(Json())) == T); }
 
private void enforceJson(string file = __FILE__, size_t line = __LINE__)(bool cond, lazy string message = "JSON exception")
{
enforceEx!JSONException(cond, message, file, line);
static if (__VERSION__ >= 2079)
enforce!JSONException(cond, message, file, line);
else
enforceEx!JSONException(cond, message, file, line);
}
 
private void enforceJson(string file = __FILE__, size_t line = __LINE__)(bool cond, lazy string message, string err_file, int err_line)
{
auto errmsg() { return format("%s(%s): Error: %s", err_file, err_line+1, message); }
enforceEx!JSONException(cond, errmsg, file, line);
static if (__VERSION__ >= 2079)
enforce!JSONException(cond, errmsg, file, line);
else
enforceEx!JSONException(cond, errmsg, file, line);
}
 
private void enforceJson(string file = __FILE__, size_t line = __LINE__)(bool cond, lazy string message, string err_file, int* err_line)
{