mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
close #1147
This commit is contained in:
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)
|
||||
|
||||
Reference in New Issue
Block a user