Files
Nim/tests/distinct/tinvalidborrow.nim
metagn b97d603cd0 some test cleanups & category reorganization (#22010)
* clean up some test categories

* mention exact slice issue

* magics into system

* move trangechecks into overflow

* move tmemory to system

* try fix CI

* try fix CI

* final CI fix
2023-06-06 06:54:07 +02:00

26 lines
563 B
Nim

discard """
cmd: "nim check --hints:off --warnings:off $file"
action: "reject"
nimout:'''
tinvalidborrow.nim(18, 3) Error: only a 'distinct' type can borrow `.`
tinvalidborrow.nim(19, 3) Error: only a 'distinct' type can borrow `.`
tinvalidborrow.nim(20, 1) Error: no symbol to borrow from found
'''
"""
# bug #516
type
TAtom = culong
Test {.borrow:`.`.} = distinct int
Foo[T] = object
a: int
Bar[T] {.borrow:`.`.} = Foo[T]
OtherFoo {.borrow:`.`.} = Foo[int]
proc `==`*(a, b: TAtom): bool {.borrow.}
var
d, e: TAtom
discard( $(d == e) )