Implement the is operator for the new static and typedesc type classes

This also makes the first baby steps towards a sound treatment of
higher-order kinds (type type int).

Adds test cases showcasing the new features.

* Also fixes breakage after the rebase
This commit is contained in:
Zahary Karadjov 2018-04-23 17:23:14 +03:00
commit a49b06a52a
10 changed files with 210 additions and 55 deletions

View file

@ -288,7 +288,8 @@ proc makeTypeDesc*(c: PContext, typ: PType): PType =
result.addSonSkipIntLit(typ)
proc makeTypeSymNode*(c: PContext, typ: PType, info: TLineInfo): PNode =
let typedesc = makeTypeDesc(c, typ)
let typedesc = newTypeS(tyTypeDesc, c)
typedesc.addSonSkipIntLit(assertNotNil(c.config, typ))
let sym = newSym(skType, c.cache.idAnon, getCurrOwner(c), info,
c.config.options).linkTo(typedesc)
return newSymNode(sym, info)