diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-12-08 23:31:06 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-12-08 23:31:06 +0100 |
commit | f70d967d2c313fc92ca864cbe856c55c40947aae (patch) | |
tree | f8051262bc5ddf551d8ab316252e3a17b3bd3d5b | |
parent | b0c682de4d4e6e60610fab9d7345a50e82ddea13 (diff) | |
download | Nim-f70d967d2c313fc92ca864cbe856c55c40947aae.tar.gz |
fixes #6889
-rw-r--r-- | compiler/sighashes.nim | 3 | ||||
-rw-r--r-- | tests/ccgbugs/tuple_canon.nim | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/compiler/sighashes.nim b/compiler/sighashes.nim index e2032294a..5d6b5978d 100644 --- a/compiler/sighashes.nim +++ b/compiler/sighashes.nim @@ -247,6 +247,9 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) = if tfNoSideEffect in t.flags: c &= ".noSideEffect" if tfThread in t.flags: c &= ".thread" if tfVarargs in t.flags: c &= ".varargs" + of tyArray: + c &= char(t.kind) + for i in 0..<t.len: c.hashType(t.sons[i], flags-{CoIgnoreRange}) else: c &= char(t.kind) for i in 0..<t.len: c.hashType(t.sons[i], flags) diff --git a/tests/ccgbugs/tuple_canon.nim b/tests/ccgbugs/tuple_canon.nim index 1a4a4d611..7e9e91836 100644 --- a/tests/ccgbugs/tuple_canon.nim +++ b/tests/ccgbugs/tuple_canon.nim @@ -98,3 +98,18 @@ proc print(pos: Position) = var x = 0.n16 var y = 0.n16 print((x, y)) + + +# bug #6889 +proc createProgressSetterWithPropSetter[T](setter: proc(v: T)) = discard + +type A = distinct array[4, float32] +type B = distinct array[3, float32] + +type Foo[T] = tuple + setter: proc(v: T) + +proc getFoo[T](): Foo[T] = discard + +createProgressSetterWithPropSetter(getFoo[A]().setter) +createProgressSetterWithPropSetter(getFoo[B]().setter) |