Skip to content

Commit

Permalink
make borrow . work with aliases if not overriden (nim-lang#22072)
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn authored and jmgomez committed Jun 11, 2023
1 parent ec68998 commit 5813087
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/distinct/tborrow.nim
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,13 @@ block: # Borrow from generic alias
c = default(C)
e = default(E)
assert c.i == int(0)
assert e.i == 0d
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]

0 comments on commit 5813087

Please sign in to comment.