Fix edge case in type hashing (#10601) [backport]

Empty types introduced by a template produced the same hash of the
"clean" type sharing the same name.
This commit is contained in:
LemonBoy 2019-02-08 09:56:32 +01:00 • committed by Andreas Rumpf
commit 631a8ab57f
3 changed files with 32 additions and 13 deletions

View file

@ -15,3 +15,18 @@ proc foo[T](t: T) =
foo(123)
foo("baz")
# Empty type in template is correctly disambiguated
block:
template foo() =
type M = object
discard
var y = M()
foo()
type M = object
x: int
var x = M(x: 1)
doAssert(x.x == 1)