Skip to content

Commit 98ccf47

Browse files
committed
Fix tests/parallel/tguard2.nim
1 parent 4ed360e commit 98ccf47

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

compiler/semdata.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type
6363
# to the user.
6464
efWantStmt, efAllowStmt, efDetermineType, efExplain,
6565
efAllowDestructor, efWantValue, efOperand, efNoSemCheck,
66-
efNoEvaluateGeneric, efInCall, efFromHlo,
66+
efNoEvaluateGeneric, efInCall, efFromHlo, efNoSem2Check,
6767
efNoUndeclared
6868
# Use this if undeclared identifiers should not raise an error during
6969
# overload resolution.

compiler/semexprs.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
20822082
var err: string
20832083
try:
20842084
result = semExpr(c, n, flags)
2085-
if result != nil:
2085+
if result != nil and efNoSem2Check notin flags:
20862086
trackStmt(c, c.module, result, isTopLevel = false)
20872087
if c.config.errorCounter != oldErrorCount:
20882088
result = nil

compiler/sigmatch.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,9 @@ proc localConvMatch(c: PContext, m: var TCandidate, f, a: PType,
19371937
var call = newNodeI(nkCall, arg.info)
19381938
call.add(f.n.copyTree)
19391939
call.add(arg.copyTree)
1940-
result = c.semTryExpr(c, call)
1940+
# XXX: This would be much nicer if we don't use `semTryExpr` and
1941+
# instead we directly search for overloads with `resolveOverloads`:
1942+
result = c.semTryExpr(c, call, {efNoSem2Check})
19411943

19421944
if result != nil:
19431945
if result.typ == nil: return nil

0 commit comments

Comments
 (0)