From cfa82e9acf9e7d3369e57c938f655ab492da9231 Mon Sep 17 00:00:00 2001 From: Andrii Riabushenko Date: Tue, 28 Jan 2020 10:11:26 +0000 Subject: [PATCH] nimv2 widestring indexing --- lib/system/widestrs.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/system/widestrs.nim b/lib/system/widestrs.nim index 59e507a4d74b..3048de82aef5 100644 --- a/lib/system/widestrs.nim +++ b/lib/system/widestrs.nim @@ -40,8 +40,8 @@ when defined(nimv2): a.bytes = bytes a.data = cast[typeof(a.data)](allocShared0(bytes)) - template `[]`(a: WideCStringObj; idx: int): Utf16Char = a.data[idx] - template `[]=`(a: WideCStringObj; idx: int; val: Utf16Char) = a.data[idx] = val + template `[]`*(a: WideCStringObj; idx: int): Utf16Char = a.data[idx] + template `[]=`*(a: WideCStringObj; idx: int; val: Utf16Char) = a.data[idx] = val template nullWide(): untyped = WideCStringObj(bytes: 0, data: nil)