diff options
-rw-r--r-- | compiler/sighashes.nim | 2 | ||||
-rw-r--r-- | tests/concepts/t8280.nim | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/compiler/sighashes.nim b/compiler/sighashes.nim index 0bf2b8459..8f95175e5 100644 --- a/compiler/sighashes.nim +++ b/compiler/sighashes.nim @@ -163,7 +163,7 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) = c.hashType t.sons[i], flags else: c.hashType t.lastSon, flags - of tyAlias, tySink, tyUserTypeClasses: + of tyAlias, tySink, tyUserTypeClasses, tyInferred: c.hashType t.lastSon, flags of tyBool, tyChar, tyInt..tyUInt64: # no canonicalization for integral types, so that e.g. ``pid_t`` is diff --git a/tests/concepts/t8280.nim b/tests/concepts/t8280.nim new file mode 100644 index 000000000..ba33af34e --- /dev/null +++ b/tests/concepts/t8280.nim @@ -0,0 +1,16 @@ +discard """ + output: "()" +""" + +type + Iterable[T] = concept x + for elem in x: + elem is T + +proc max[A](iter: Iterable[A]): A = + discard + +type + MyType = object + +echo max(@[MyType()]) |