fix assignment to converted concept type (#15051)

* fix assignment to converted concept type

* check for resolved concepts

* add extra test
This commit is contained in:
jcosborn 2020-07-24 14:19:11 -05:00 • committed by GitHub
commit add003a074
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 17 deletions

View file

@ -1070,7 +1070,11 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
if x == y: return true
var a = skipTypes(x, {tyGenericInst, tyAlias})
while a.kind == tyUserTypeClass and tfResolved in a.flags:
a = skipTypes(a[^1], {tyGenericInst, tyAlias})
var b = skipTypes(y, {tyGenericInst, tyAlias})
while b.kind == tyUserTypeClass and tfResolved in b.flags:
b = skipTypes(b[^1], {tyGenericInst, tyAlias})
assert(a != nil)
assert(b != nil)
if a.kind != b.kind: