This commit is contained in:
parent
04c48e3c5b
commit
84fab7f39b
2 changed files with 21 additions and 1 deletions
|
|
@ -1149,13 +1149,14 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
|
||||||
of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCstring,
|
of tyEmpty, tyChar, tyBool, tyNil, tyPointer, tyString, tyCstring,
|
||||||
tyInt..tyUInt64, tyTyped, tyUntyped, tyVoid:
|
tyInt..tyUInt64, tyTyped, tyUntyped, tyVoid:
|
||||||
result = sameFlags(a, b)
|
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:
|
# additional requirement for the caching of generics for importc'ed types:
|
||||||
# the symbols must be identical too:
|
# the symbols must be identical too:
|
||||||
let symFlagsA = if a.sym != nil: a.sym.flags else: {}
|
let symFlagsA = if a.sym != nil: a.sym.flags else: {}
|
||||||
let symFlagsB = if b.sym != nil: b.sym.flags else: {}
|
let symFlagsB = if b.sym != nil: b.sym.flags else: {}
|
||||||
if (symFlagsA+symFlagsB) * {sfImportc, sfExportc} != {}:
|
if (symFlagsA+symFlagsB) * {sfImportc, sfExportc} != {}:
|
||||||
result = symFlagsA == symFlagsB
|
result = symFlagsA == symFlagsB
|
||||||
|
|
||||||
of tyStatic, tyFromExpr:
|
of tyStatic, tyFromExpr:
|
||||||
result = exprStructuralEquivalent(a.n, b.n) and sameFlags(a, b)
|
result = exprStructuralEquivalent(a.n, b.n) and sameFlags(a, b)
|
||||||
if result and a.len == b.len and a.len == 1:
|
if result and a.len == b.len and a.len == 1:
|
||||||
|
|
|
||||||
19
tests/alias/t19349.nim
Normal file
19
tests/alias/t19349.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
discard """
|
||||||
|
action: "compile"
|
||||||
|
"""
|
||||||
|
|
||||||
|
type
|
||||||
|
Vec3[T: SomeNumber] = object
|
||||||
|
arr: array[3, T]
|
||||||
|
|
||||||
|
var
|
||||||
|
cfloatArr: array[3, array[3, cfloat]]
|
||||||
|
cfloatSeq = newSeq[Vec3[cfloat]]()
|
||||||
|
for row in cfloatArr:
|
||||||
|
cfloatSeq.add(Vec3[float32](arr: [row[0], row[1], row[2]]))
|
||||||
|
|
||||||
|
var
|
||||||
|
cuintArr: array[3, array[3, cuint]]
|
||||||
|
cuintSeq = newSeq[Vec3[cuint]]()
|
||||||
|
for row in cuintArr:
|
||||||
|
cuintSeq.add(Vec3[uint32](arr: [row[0], row[1], row[2]]))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue