From 92a7b78f4a2b13bd56260694c0035f7c71f10cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Fri, 26 Apr 2019 00:17:04 +0200 Subject: [PATCH] Nim HEAD support --- json_rpc/jsonmarshal.nim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/json_rpc/jsonmarshal.nim b/json_rpc/jsonmarshal.nim index 0efd843..b0c5a48 100644 --- a/json_rpc/jsonmarshal.nim +++ b/json_rpc/jsonmarshal.nim @@ -15,11 +15,12 @@ proc `%`*(n: ref SomeInteger): JsonNode = else: result = newJInt(n[]) -proc `%`*[T](option: Option[T]): JsonNode = - if option.isSome: - result = `%`(option.get) - else: - result = newJNull() +when (NimMajor, NimMinor, NimPatch) < (0, 19, 9): + proc `%`*[T](option: Option[T]): JsonNode = + if option.isSome: + result = `%`(option.get) + else: + result = newJNull() # Compiler requires forward decl when processing out of module proc fromJson(n: JsonNode, argName: string, result: var bool)