mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-28 02:03:59 +00:00
(cherry picked from commit 84fab7f39b)
This commit is contained in:
@@ -1145,13 +1145,14 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
|
||||
of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCstring,
|
||||
tyInt..tyUInt64, tyTyped, tyUntyped, tyVoid:
|
||||
result = sameFlags(a, b)
|
||||
if result and PickyCAliases in c.flags:
|
||||
if result and {PickyCAliases, ExactTypeDescValues} <= c.flags:
|
||||
# additional requirement for the caching of generics for importc'ed types:
|
||||
# the symbols must be identical too:
|
||||
let symFlagsA = if a.sym != nil: a.sym.flags else: {}
|
||||
let symFlagsB = if b.sym != nil: b.sym.flags else: {}
|
||||
if (symFlagsA+symFlagsB) * {sfImportc, sfExportc} != {}:
|
||||
result = symFlagsA == symFlagsB
|
||||
|
||||
of tyStatic, tyFromExpr:
|
||||
result = exprStructuralEquivalent(a.n, b.n) and sameFlags(a, b)
|
||||
if result and a.len == b.len and a.len == 1:
|
||||
|
||||
Reference in New Issue
Block a user