From 3586dafc1937d4cbd0670aab985b0a6abe270794 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Mon, 9 Mar 2020 19:05:00 -0700 Subject: [PATCH] fixup --- lib/system.nim | 1 - tests/magics/mresolves.nim | 3 ++- tests/magics/tresolve_overloads.nim | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index b0d32635eec1..165295b75189 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2681,7 +2681,6 @@ when defined(himHasOverloadResolve): ## without calling it. Unlike `compiles(foo(args))`, the body is not analyzed. ## Also works with `compiles(mymod.mysym)` to return the symChoice overload ## set. - discard when defined(nimV2): import system/repr_v2 diff --git a/tests/magics/mresolves.nim b/tests/magics/mresolves.nim index eb1837f60740..47910642dc1c 100644 --- a/tests/magics/mresolves.nim +++ b/tests/magics/mresolves.nim @@ -42,4 +42,5 @@ macro inspect*(a: typed, resolveLet: static bool = false): untyped = s.add a.lineInfoObj.toStr & ": " s.add a.repr & " = " inspectImpl(s, a, resolveLet) - echo s + when defined(nimTestsResolvesDebug): + echo s diff --git a/tests/magics/tresolve_overloads.nim b/tests/magics/tresolve_overloads.nim index a8d53ead2dd2..fee089e5175a 100644 --- a/tests/magics/tresolve_overloads.nim +++ b/tests/magics/tresolve_overloads.nim @@ -1,5 +1,13 @@ #[ -D20190825T173945 +use -d:nimTestsResolvesDebug to make the `inspect` macro print debug info showing +resolved symbol locations, for example: + +`inspect resolveSymbol(`$`)` would print: + +Nim/tests/magics/tresolve_overloads.nim:133:28: $ = closedSymChoice: + Nim/lib/system/dollars.nim:124:1 proc `$`[T](x: set[T]): string + Nim/lib/system/dollars.nim:140:1 proc `$`[T; U](x: HSlice[T, U]): string + Nim/lib/system/dollars.nim:14:1 proc `$`(x: bool): string {.magic: "BoolToStr", noSideEffect.} ]# import ./mresolves