This example compiles
type
MyField = object
b: seq[string]
MyObject = object
f: MyField
proc getX(x: MyObject): lent MyField =
x.f
let a = MyObject()
echo a.getX.b.len
This one doesn't compile (the only difference is pragma):
type
MyField = object
b: seq[string]
MyObject = object
f: MyField
proc getX(x: MyObject): lent MyField {.inline.} =
x.f
let a = MyObject()
echo a.getX.b.len
Compilation fails with error: Error: type expected