Support doc comments in new-styled concepts (#20752)

Support comments in new-styled concepts
This commit is contained in:
konsumlamm
2022-11-04 13:32:41 +01:00
committed by GitHub
parent ecc8f61fe4
commit 4491da4c4d
2 changed files with 5 additions and 0 deletions

View File

@@ -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

View File

@@ -0,0 +1,3 @@
type Foo = concept
## doc comment
proc foo(x: Self)