Fixed #18838 (#18841) [backport]

This commit is contained in:
Jason Beetham 2021-09-13 01:35:19 -06:00 • committed by GitHub
commit 3f3e0fa303
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 2 deletions

View file

@ -344,7 +344,11 @@ proc handleGenericInvocation(cl: var TReplTypeVars, t: PType): PType =
x = lookupTypeVar(cl, x)
if x != nil:
if header == t: header = instCopyType(cl, t)
header[i] = x
header[i] =
if x.kind == tyGenericInst:
t[i]
else:
x
propagateToOwner(header, x)
else:
propagateToOwner(header, x)