A type can not be refined when used as result type of a function. When a '=' is missing between result type and function body it might look like it, however.
Before
def test(): T {}
After:
def test(): T = {}