summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2020-03-30 03:47:02 +0300
committerAndreas Rumpf <rumpf_a@web.de>2020-04-01 19:38:44 +0200
commitd374c6373bed4d6807ff70b6179328e79fbe1ac8 (patch)
tree30b2b76bd8a95b0f5a9ee224863763323501061a
parent2b66d665679912e62244a94c134ce910838fc107 (diff)
downloadNim-d374c6373bed4d6807ff70b6179328e79fbe1ac8.tar.gz
Fix tests/parallel/tguard2.nim
-rw-r--r--compiler/semdata.nim2
-rw-r--r--compiler/semexprs.nim2
-rw-r--r--compiler/sigmatch.nim4
3 files changed, 5 insertions, 3 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim
index 367c0eaf6..7fa671722 100644
--- a/compiler/semdata.nim
+++ b/compiler/semdata.nim
@@ -63,7 +63,7 @@ type
       # to the user.
     efWantStmt, efAllowStmt, efDetermineType, efExplain,
     efAllowDestructor, efWantValue, efOperand, efNoSemCheck,
-    efNoEvaluateGeneric, efInCall, efFromHlo,
+    efNoEvaluateGeneric, efInCall, efFromHlo, efNoSem2Check,
     efNoUndeclared
       # Use this if undeclared identifiers should not raise an error during
       # overload resolution.
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index e405ec0ef..d920b0f25 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -2082,7 +2082,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
   var err: string
   try:
     result = semExpr(c, n, flags)
-    if result != nil:
+    if result != nil and efNoSem2Check notin flags:
       trackStmt(c, c.module, result, isTopLevel = false)
     if c.config.errorCounter != oldErrorCount:
       result = nil
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 79b3ea94c..04ceb47b8 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1937,7 +1937,9 @@ proc localConvMatch(c: PContext, m: var TCandidate, f, a: PType,
   var call = newNodeI(nkCall, arg.info)
   call.add(f.n.copyTree)
   call.add(arg.copyTree)
-  result = c.semTryExpr(c, call)
+  # XXX: This would be much nicer if we don't use `semTryExpr` and
+  # instead we directly search for overloads with `resolveOverloads`:
+  result = c.semTryExpr(c, call, {efNoSem2Check})
 
   if result != nil:
     if result.typ == nil: return nil