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
='n212' href='#n212'>212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458