Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
虽然我已经标记了'lateinit',但它仍然没有初始化。是个鬼虫,昨晚一切正常,今天不行了,好累在这里输入图片描述
它没有被初始化,因为你标记了它lateinit并且从未真正初始化它。
lateinit
您仍然需要一些方法userMapper = ...,并且您必须先调用此方法,然后才能调用userCheck。
userMapper = ...
userCheck
但最好lateinit在构造函数中删除和初始化。