mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
Support doc comments in new-styled concepts (#20752)
Support comments in new-styled concepts
This commit is contained in:
@@ -61,6 +61,8 @@ proc semConceptDecl(c: PContext; n: PNode): PNode =
|
||||
for i in 0..<n.len-1:
|
||||
result[i] = n[i]
|
||||
result[^1] = semConceptDecl(c, n[^1])
|
||||
of nkCommentStmt:
|
||||
discard
|
||||
else:
|
||||
localError(c.config, n.info, "unexpected construct in the new-styled concept: " & renderTree(n))
|
||||
result = n
|
||||
|
||||
3
tests/concepts/t20237.nim
Normal file
3
tests/concepts/t20237.nim
Normal file
@@ -0,0 +1,3 @@
|
||||
type Foo = concept
|
||||
## doc comment
|
||||
proc foo(x: Self)
|
||||
Reference in New Issue
Block a user