[BZ-986000] consider imports when determining the type of a field