Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/seminst.nim
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ proc sameInstantiation(a, b: TInstantiation): bool =
if not compareTypes(a.concreteTypes[i], b.concreteTypes[i],
flags = {ExactTypeDescValues,
ExactGcSafety,
PickyCAliases}): return
PickyCAliases,
PickyBackendAliases}): return
result = true
else:
result = false
Expand Down
3 changes: 2 additions & 1 deletion compiler/semtypinst.nim
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ proc searchInstTypes*(g: ModuleGraph; key: PType): PType =
for j in FirstGenericParamAt..<key.kidsLen:
# XXX sameType is not really correct for nested generics?
if not compareTypes(inst[j], key[j],
flags = {ExactGenericParams, PickyCAliases}):
flags = {ExactGenericParams, PickyCAliases,
PickyBackendAliases}):
break matchType

return inst
Expand Down
16 changes: 16 additions & 0 deletions tests/ccgbugs2/tcodegen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,19 @@ block: # importc type inheritance
doAssert(cast[cint](b) == 123)
var c = foo(b)
doAssert(cast[cint](c) == 123)


# bug #23765
Comment thread
ringabout marked this conversation as resolved.
type
X11[T, E] = object
m: T
B = X11[culonglong, cstring]
S = ref object of RootObj

proc j[T, E](m: X11[T, E]): T = discard
proc n(T: typedesc[SomeUnsignedInt]): X11[T, cstring] = discard
method call(client: S): uint64 {.base.} =
discard j(n(uint64))

var s = S()
discard s.call()
Loading