fixes #13378 [backport] (#13392)

This commit is contained in:
Andreas Rumpf 2020-02-11 23:48:41 +01:00 • committed by GitHub
commit c446c0f57a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -1942,6 +1942,8 @@ proc localConvMatch(c: PContext, m: var TCandidate, f, a: PType,
if result != nil:
if result.typ == nil: return nil
# bug #13378, ensure we produce a real generic instantiation:
result = c.semExpr(c, call)
# resulting type must be consistent with the other arguments:
var r = typeRel(m, f[0], result.typ)
if r < isGeneric: return nil