diff options
author | metagn <metagngn@gmail.com> | 2023-06-11 20:19:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-11 19:19:48 +0200 |
commit | 5139a2ec37960f7d16a284369e0497efa331cd87 (patch) | |
tree | 756b0664e660e777a8f989093290e752a9fd3a4e /tests/distinct | |
parent | 9b5f310b9e42df56d4c641e08fb2528c17667543 (diff) | |
download | Nim-5139a2ec37960f7d16a284369e0497efa331cd87.tar.gz |
make borrow `.` work with aliases if not overriden (#22072)
Diffstat (limited to 'tests/distinct')
-rw-r--r-- | tests/distinct/tborrow.nim | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/distinct/tborrow.nim b/tests/distinct/tborrow.nim index 35652e2e0..8a40982a8 100644 --- a/tests/distinct/tborrow.nim +++ b/tests/distinct/tborrow.nim @@ -88,4 +88,13 @@ block: # Borrow from generic alias c = default(C) e = default(E) assert c.i == int(0) - assert e.i == 0d \ No newline at end of file + assert e.i == 0d + +block: # issue #22069 + type + Vehicle[C: static[int]] = object + color: array[C, int] + Car[C: static[int]] {.borrow: `.`.} = distinct Vehicle[C] + MuscleCar = Car[128] + var x: MuscleCar + doAssert x.color is array[128, int] |