This is a small assumption - the features in scala are converted to a java interface based on this article. So your trait:
trait Vehicle {
@Autowired
private var myDistanceLogger: MyDistanceLogger = null
}
will be translated into:
public interface Vehicle {
public MyDistanceLogger myDistanceLogger();
}
and it @Autowireddoesn’t make sense in getter, I assume that this is the reason why this does not work out automatically.
source
share