Custom pragmas in proc types (#8205)

This commit is contained in:
cooldome 2018-07-09 12:11:03 +02:00 • committed by Andreas Rumpf
commit dec97924a4
5 changed files with 30 additions and 14 deletions

View file

@ -145,4 +145,12 @@ block:
type Annotated {.simpleAttr.} = object
proc generic_proc[T]() =
assert Annotated.hasCustomPragma(simpleAttr)
assert Annotated.hasCustomPragma(simpleAttr)
#--------------------------------------------------------------------------
# Pragma on proc type
let a: proc(x: int) {.defaultValue(5).} = nil
static:
doAssert hasCustomPragma(a.type, defaultValue)