我在FirebaseUserAuth
类中有两个构造函数,它给出了一个错误:声明具有相同的 java 签名。构造函数的参数不同。为什么它给出相同的签名错误?如何解决?
class FirebaseUserAuth(private val auth: FirebaseAuth,
private val loginCallBack: ((LoginAuthData) -> Unit)?,
private val registerVM_CallBack: ((RegisterAuthData) -> Unit)?)
{
constructor(auth: FirebaseAuth, loginCallBack: (LoginAuthData) -> Unit): this(auth, loginCallBack, null)
constructor(auth: FirebaseAuth, registerCallBack: (RegisterAuthData) -> Unit): this(auth, null, registerCallBack)
}
错误
> Platform declaration clash:The following declarations have the same JVM
> signature (Lcom/google/fireBase/auth/FirebaseAuth;Lkotlin/jvm/
> functions/Function1;)V):
>
> • public constructor FirebaseUserAuth(auth: FirebaseAuth,
> loginCallBack: (LoginAuthData) -> Unit) defined.
> com.examgle.data.FirebaseUserAuth
>
> • public constructor FirebaseUserAuth(auth: FirebaseAuth,
> registerCallBack: (RegisterAuthData) -> Unit) defined.
> com.examgle.data.FirebaseUserAuth