ugh, maybe broke git
This commit is contained in:
parent
dc669155e3
commit
4741e8f9a1
25 changed files with 587 additions and 172 deletions
15
tests/accept/compile/tconstraints.nim
Normal file
15
tests/accept/compile/tconstraints.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
|
||||
proc myGenericProc[T: object|tuple|int|ptr|ref|distinct](x: T): string =
|
||||
result = $x
|
||||
|
||||
type
|
||||
TMyObj = tuple[x, y: int]
|
||||
|
||||
var
|
||||
x: TMyObj
|
||||
|
||||
assert myGenericProc(232) == "232"
|
||||
assert myGenericProc(x) == "(x: 0, y: 0)"
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue