allow importing on top of resolved but undefined variables. fixes #6936