* fixes #15884

* micro optimization
This commit is contained in:
Andreas Rumpf 2021-06-10 18:19:20 +02:00 • committed by GitHub
commit f65f760dee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 3 deletions

View file

@ -100,6 +100,15 @@ proc fitNode(c: PContext, formal: PType, arg: PNode; info: TLineInfo): PNode =
else:
result = fitNodePostMatch(c, formal, result)
proc fitNodeForLocalVar(c: PContext, formal: PType, arg: PNode; info: TLineInfo): PNode =
let a = fitNode(c, formal, arg, info)
if formal.kind in {tyVar, tyLent}:
#classifyViewType(formal) != noView:
result = newNodeIT(nkHiddenAddr, a.info, formal)
result.add a
else:
result = a
proc inferWithMetatype(c: PContext, formal: PType,
arg: PNode, coerceDistincts = false): PNode