fixes #12172
This commit is contained in:
parent
ee6df5bd24
commit
5018e7f304
2 changed files with 3 additions and 3 deletions
|
|
@ -134,7 +134,7 @@ to do it.
|
||||||
]#
|
]#
|
||||||
|
|
||||||
import
|
import
|
||||||
intsets, ast, msgs, renderer, magicsys, types, idents,
|
intsets, ast, astalgo, msgs, renderer, magicsys, types, idents,
|
||||||
strutils, options, dfa, lowerings, tables, modulegraphs, msgs,
|
strutils, options, dfa, lowerings, tables, modulegraphs, msgs,
|
||||||
lineinfos, parampatterns, sighashes
|
lineinfos, parampatterns, sighashes
|
||||||
|
|
||||||
|
|
@ -322,7 +322,7 @@ proc makePtrType(c: Con, baseType: PType): PType =
|
||||||
proc genOp(c: Con; t: PType; kind: TTypeAttachedOp; dest, ri: PNode): PNode =
|
proc genOp(c: Con; t: PType; kind: TTypeAttachedOp; dest, ri: PNode): PNode =
|
||||||
var op = t.attachedOps[kind]
|
var op = t.attachedOps[kind]
|
||||||
|
|
||||||
if op == nil:
|
if op == nil or op.ast[genericParamsPos].kind != nkEmpty:
|
||||||
# give up and find the canonical type instead:
|
# give up and find the canonical type instead:
|
||||||
let h = sighashes.hashType(t, {CoType, CoConsiderOwned, CoDistinct})
|
let h = sighashes.hashType(t, {CoType, CoConsiderOwned, CoDistinct})
|
||||||
let canon = c.graph.canonTypes.getOrDefault(h)
|
let canon = c.graph.canonTypes.getOrDefault(h)
|
||||||
|
|
|
||||||
|
|
@ -641,7 +641,7 @@ proc createTypeBoundOps(g: ModuleGraph; c: PContext; orig: PType; info: TLineInf
|
||||||
let typ = orig.skipTypes({tyGenericInst, tyAlias, tySink})
|
let typ = orig.skipTypes({tyGenericInst, tyAlias, tySink})
|
||||||
g.canonTypes[h] = typ
|
g.canonTypes[h] = typ
|
||||||
canon = typ
|
canon = typ
|
||||||
elif canon != orig:
|
if canon != orig:
|
||||||
overwrite = true
|
overwrite = true
|
||||||
|
|
||||||
# multiple cases are to distinguish here:
|
# multiple cases are to distinguish here:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue