Automatic dereferencing is removed (#20531)

This commit is contained in:
ringabout 2022-10-10 21:02:23 +08:00 • committed by GitHub
commit d954e698b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 104 deletions

View file

@ -195,7 +195,7 @@ type
ideRecompile, ideChanged, ideType, ideDeclaration
Feature* = enum ## experimental features; DO NOT RENAME THESE!
implicitDeref,
implicitDeref, # deadcode; remains here for backwards compatibility
dotOperators,
callOperator,
parallel,

View file

@ -580,27 +580,6 @@ proc semOverloadedCall(c: PContext, n, nOrig: PNode,
"Non-matching candidates for " & renderTree(n) & "\n" &
candidates)
result = semResolvedCall(c, r, n, flags)
elif implicitDeref in c.features and canDeref(n):
# try to deref the first argument and then try overloading resolution again:
#
# XXX: why is this here?
# it could be added to the long list of alternatives tried
# inside `resolveOverloads` or it could be moved all the way
# into sigmatch with hidden conversion produced there
#
n[1] = n[1].tryDeref
var r = resolveOverloads(c, n, nOrig, filter, flags, errors, efExplain in flags)
if r.state == csMatch: result = semResolvedCall(c, r, n, flags)
else:
# get rid of the deref again for a better error message:
n[1] = n[1][0]
#notFoundError(c, n, errors)
if efExplain notin flags:
# repeat the overload resolution,
# this time enabling all the diagnostic output (this should fail again)
discard semOverloadedCall(c, n, nOrig, filter, flags + {efExplain})
elif efNoUndeclared notin flags:
notFoundError(c, n, errors)
else:
if efExplain notin flags:
# repeat the overload resolution,

View file

@ -932,12 +932,6 @@ proc resolveIndirectCall(c: PContext; n, nOrig: PNode;
t: PType): TCandidate =
initCandidate(c, result, t)
matches(c, n, nOrig, result)
if result.state != csMatch:
# try to deref the first argument:
if implicitDeref in c.features and canDeref(n):
n[1] = n[1].tryDeref
initCandidate(c, result, t)
matches(c, n, nOrig, result)
proc bracketedMacro(n: PNode): PSym =
if n.len >= 1 and n[0].kind == nkSym: