From ccccd30cf6b8704c224e42001d0def2b566d5388 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 27 Aug 2020 11:25:20 +0200 Subject: [PATCH] fixes #15221 (#15230) --- lib/impure/nre.nim | 2 +- lib/pure/typetraits.nim | 90 ++++++++++++++++++++--------------------- 2 files changed, 45 insertions(+), 47 deletions(-) diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim index 88fa0b323d..71936bd5f2 100644 --- a/lib/impure/nre.nim +++ b/lib/impure/nre.nim @@ -367,7 +367,7 @@ func contains*(pattern: CaptureBounds, name: string): bool = func contains*(pattern: Captures, name: string): bool = name in CaptureBounds(pattern) -func checkNamedCaptured(pattern: RegexMatch, name: string): void = +func checkNamedCaptured(pattern: RegexMatch, name: string) = if not (name in pattern.captureBounds): raise newException(KeyError, "Group '" & name & "' was not captured") diff --git a/lib/pure/typetraits.nim b/lib/pure/typetraits.nim index 0e23077ac3..0a05b5dede 100644 --- a/lib/pure/typetraits.nim +++ b/lib/pure/typetraits.nim @@ -115,54 +115,52 @@ macro genericParamsImpl(T: typedesc): untyped = impl = impl[1] while true: case impl.kind - of nnkSym: - impl = impl.getImpl - continue - of nnkTypeDef: - impl = impl[2] - continue - of nnkTypeOfExpr: - impl = getTypeInst(impl[0]) - continue - of nnkBracketExpr: - for i in 1..