close #1147
This commit is contained in:
parent
905a22d137
commit
e31575c27a
1 changed files with 16 additions and 0 deletions
16
tests/concepts/tmisc_issues.nim
Normal file
16
tests/concepts/tmisc_issues.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
discard """
|
||||||
|
output: '''true'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
# https://github.com/nim-lang/Nim/issues/1147
|
||||||
|
type TTest = object
|
||||||
|
vals: seq[int]
|
||||||
|
|
||||||
|
proc add*(self: var TTest, val: int) =
|
||||||
|
self.vals.add(val)
|
||||||
|
|
||||||
|
type CAddable = concept x
|
||||||
|
x[].add(int)
|
||||||
|
|
||||||
|
echo((ref TTest) is CAddable)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue