I was having the same issue. It turns out I was circularly importing classes, which is apparently a limitation. (See these GitHub issues: #20361, #4149, #10712)
Note that it seems that the circular reference is also limited between files, not simply types.
See this other answer