fixes #20139; hash types based on its path relative to its package path (#21274) [backport:1.6]

* fixes #20139; hash types based on its path relative its project

* add a test case

* fixes procs

* better implementation and test case

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
ringabout 2023-03-02 16:16:28 +08:00 • committed by GitHub
commit 38d299dfc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 143 additions and 74 deletions

View file

@ -0,0 +1,4 @@
type MyObj* = object
field1*: int
s*: string
ch*: char

View file

@ -0,0 +1,4 @@
type MyObj* = object
s*: string
field1*: int
ch*: char

10
tests/ccgbugs/t20139.nim Normal file
View file

@ -0,0 +1,10 @@
discard """
joinable: false
"""
# bug #20139
import m1/defs as md1
import m2/defs as md2
doAssert $(md1.MyObj(field1: 1)) == """(field1: 1, s: "", ch: '\x00')"""
doAssert $(md2.MyObj(field1: 1)) == """(s: "", field1: 1, ch: '\x00')"""