ugh, maybe broke git
This commit is contained in:
parent
dc669155e3
commit
4741e8f9a1
25 changed files with 587 additions and 172 deletions
18
tests/reject/tconstraints.nim
Normal file
18
tests/reject/tconstraints.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
line: 15
|
||||
errormsg: "type mismatch: got (int)"
|
||||
"""
|
||||
|
||||
proc myGenericProc[T: object|tuple|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