tparse.nim 353 B

12345678910111213141516171819
  1. # issue #16324
  2. {.push experimental: "notnil".}
  3. block:
  4. type Foo = ref object
  5. value: int
  6. proc newFoo1(): Foo not nil = # This compiles
  7. return Foo(value: 1)
  8. proc newFoo2(): Foo not nil {.inline.} = # This does not
  9. return Foo(value: 1)
  10. doAssert newFoo1().value == 1
  11. doAssert newFoo2().value == 1
  12. {.pop.}