new-style concepts implementation, WIP (#15251)
* fixes #15210 [backport:1.2] * make tests green * make ordinal work * makes Swapable test compile * make Indexable example work * concepts: 'self' is now 'Self' * concepts: make Dictionary example compile * document the new concept implementation * concepts: make typeDesc work properly * concepts: allow documentation comments (d'oh)
This commit is contained in:
parent
3f38f8fbb7
commit
6278b5d89a
19 changed files with 528 additions and 59 deletions
|
|
@ -299,7 +299,9 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
|
|||
if t.n != nil:
|
||||
result.add t.n.copyTree
|
||||
of tyOwned: result = mapTypeToBracket("owned", mBuiltinType, t, info)
|
||||
of tyOptDeprecated: doAssert false
|
||||
of tyConcept:
|
||||
result = mapTypeToBracket("concept", mNone, t, info)
|
||||
result.add t.n.copyTree
|
||||
|
||||
proc opMapTypeToAst*(cache: IdentCache; t: PType; info: TLineInfo; idgen: IdGenerator): PNode =
|
||||
result = mapTypeToAstX(cache, t, info, idgen, inst=false, allowRecursionX=true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue